I\'m using urlretrieve from the urllib module.
I cannot seem to find how to add a User-Agent description to my requests.
Is it possible with urlretrieve? o
You can use URLopener or FancyURLopener classes. The 'version' argument specifies the user agent of the opener object.
opener = FancyURLopener({})
opener.version = 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.69 Safari/537.36'
opener.retrieve('http://example.com', 'index.html')