Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def funRequestsDownload(searchTerm):
- print("Getting image for track ", searchTerm)
- headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36', 'content-length': bytes(searchTerm, 'utf-8')}
- queryStringParameters = {'hl': "en", "tbm": "isch", "source": "hp", "biw":1109, "bih": 475, "q": "SEARCH TERMS", "oq":"meme", "gs_l":"img.3..35i39k1j0l9.21651.21983.0.22205.10.10.0.0.0.0.131.269.2j1.3.0....0...1.1.64.img..7.3.267.0.4mTf5BYtfj8"}
- payload = {'value': searchTerm}
- url = 'http://www.google.co.uk'
- dataDump = requests.get(url, data=payload, headers=headers, "Query String Parameters"=queryStringParameters)
- temp = dataDump.content
- with open('C:/Users/Jordan/Desktop/Music Program/temp.html', 'w') as file:
- file.write(str(temp))
- file.close
- return(temp)
- print("Downloaded image for track ", searchTerm)
Advertisement
Add Comment
Please, Sign In to add comment