Answer the question
In order to leave comments, you need to log in
Error when requesting via urllib2.Request
I execute the code:
Exception crashes: urllib2.HTTPError: HTTP Error 507: Insufficient Storage
What could be the problem?
req = urllib2.Request("http://tutu.ru/poezda/station_d.php?nnst=2600186")
response = urllib2.urlopen(req)
Answer the question
In order to leave comments, you need to log in
507 Insufficient Storage - There is not enough space to complete the current request. The problem may be temporary. Introduced in WebDAV.
funny, but I have the same problem with your code. I tried to use the urllib module - it works. I can't understand why this is so :) maybe urllib capabilities will be enough for the task?
Server error - most likely, by default, urllib2 sends some “wrong” headers, or something like that.
A simple recipe is to catch the request that urllib2 sends with a sniffer and compare it with what is sent, for example, by browsers.
Maybe there is a problem with gzip or encoding - the same curl fulfills this request perfectly (checked with hundreds of requests)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question