can't access from python - error 401 - unauthorized

  • 1
  • Question
  • Updated 5 years ago
Hi!

I'm having troubles accesing the API throuh a python script, though I have a valid response on the browser (both IE and Firefox)
This is the errors I've got with my script:

Traceback (most recent call last):
File "D:\OSGeo4W\\bin\consulta_pronostico_wunderground_1day.py", line 85, in <
module>
f=urllib2.urlopen(http_str)
File "D:\OSGeo4W\apps\Python27\lib\urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "D:\OSGeo4W\apps\Python27\lib\urllib2.py", line 410, in open
response = meth(req, response)
File "D:\OSGeo4W\apps\Python27\lib\urllib2.py", line 523, in http_response
'http', request, response, code, msg, hdrs)
File "D:\OSGeo4W\apps\Python27\lib\urllib2.py", line 442, in error
result = self._call_chain(*args)
File "D:\OSGeo4W\apps\Python27\lib\urllib2.py", line 382, in _call_chain
result = func(*args)
File "D:\OSGeo4W\apps\Python27\lib\urllib2.py", line 629, in http_error_302
return self.parent.open(new, timeout=req.timeout)
File "D:\OSGeo4W\apps\Python27\lib\urllib2.py", line 410, in open
response = meth(req, response)
File "D:\OSGeo4W\apps\Python27\lib\urllib2.py", line 523, in http_response
'http', request, response, code, msg, hdrs)
File "D:\OSGeo4W\apps\Python27\lib\urllib2.py", line 448, in error
return self._call_chain(*args)
File "D:\OSGeo4W\apps\Python27\lib\urllib2.py", line 382, in _call_chain
result = func(*args)
File "D:\OSGeo4W\apps\Python27\lib\urllib2.py", line 531, in http_error_defaul
t
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 401: Unauthorized

Any help would be much aprecciated!

Thanks in advanced!

Julio
Photo of Juliomm

Juliomm

  • 7 Posts
  • 0 Reply Likes

Posted 5 years ago

  • 1

Be the first to post a reply!