headers = { 'User-Agent': 'Mozilla/5.0' } request = Request(uri, headers=headers) stream = urlopen(request)
Remarks:
When using a URL string with urlopen the header User-Agent is not defined, and this causes the server to return 403 Forbidden.
urlopen