You can manipulate user-agent,the easiest way is of course to use Requests(should always be used anyway and not urllib).
This post set user-agent with Requests to get access.
λ ptpython >>> import requests >>> r = requests.get("https://httpbin.org/headers", headers={"user-agent": "My cool Useragent" }) >>> print(r.text) { "headers": { "Accept": "*/*", "Accept-Encoding": "gzip, deflate", "Connection": "close", "Host": "httpbin.org", "User-Agent": "My cool Useragent" } }I have a post here where i us urllib with FancyURLopener
This post set user-agent with Requests to get access.