I want to get value of property with name, path, size, date, time and download link using Beautifulsoup(which is the best way to do this or if there are any other options like urllib2). But I am unable to get the download link. I am using following code.
from bs4 import BeautifulSoup
import os
import re
import requests
import time
import datetime
import urllib
def check_url(url):
if "skype:.com" in url:
return True
return False
def check_link(url):
headers = {"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36"}
payload = {'source': 'windows', 'target':'mac', 'payload': 'cmd']
payload = json.dumps(payload)
try:
r = requests.get(url, headers=headers,verify=False, data=payload)
except Exception as e:
if check_url(url):
return True
else:
return False
try:
response = urllib.request.urlopen(url,data=urllib.request.urlretrieve(url, "retrieved.txt"))
except Exception as e:
if check_url(url):
return True
else:
return False
with open("retrieved.txt","r") as f:
return f.read()
def get_info(url):
request = requests.get(url)
if request.status_code be359ba680
Related links:
Comments