Last active
April 2, 2020 10:22
-
-
Save JeyKJey/083c1b5e14e64b3b1ff734bb45b859be to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# library to generate user agent | |
from user_agent import generate_user_agent | |
# generate a user agent | |
headers = {'User-Agent': generate_user_agent(device_type="desktop", os=('mac', 'linux'))} | |
#headers = {'User-Agent': 'Mozilla/5.0 (X11; Linux i686 on x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.63 Safari/537.36'} | |
page_response = requests.get(page_link, timeout=5, headers=headers) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment