By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,427 Members | 1,356 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,427 IT Pros & Developers. It's quick & easy.

urllib2 gets 404 error cannot display after a while

P: 1
i use urllib2 to open the websites and get info. it works for a while, then will be stopped, the error in idle is http error 404 no such domain. but i just changed the parameters in the url by looping, and i can open it in ie or firefox. any one have any idea to deal with it? if I running 2 more similar programs in command line at same time, them will be stopped more sooner.

my code is running in python 2.5 + tor.

Thks a lot.


"Traceback (most recent call last):
File "C:\Documents and Settings\XXXX\Desktop\NZ_New - Copy\NZ 1- 40 14022009\nz_new1.py", line 191, in <module>
Main()
File "C:\Documents and Settings\XXXX\Desktop\NZ_New - Copy\NZ 1- 40 14022009\nz_new1.py", line 69, in Main
Process(1)
File "C:\Documents and Settings\XXXX\Desktop\NZ_New - Copy\NZ 1- 40 14022009\nz_new1.py", line 141, in Process
input_page = urllib2.urlopen(req)
File "C:\Python25\lib\urllib2.py", line 121, in urlopen
return _opener.open(url, data)
File "C:\Python25\lib\urllib2.py", line 380, in open
response = meth(req, response)
File "C:\Python25\lib\urllib2.py", line 491, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Python25\lib\urllib2.py", line 418, in error
return self._call_chain(*args)
File "C:\Python25\lib\urllib2.py", line 353, in _call_chain
result = func(*args)
File "C:\Python25\lib\urllib2.py", line 499, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 404: No such domain"
Feb 26 '09 #1
Share this Question
Share on Google+
1 Reply


sharat87
P: 6
hey,
could you put the code of the loop you are talking about... and also give some code around the lines 191, 69 and 141

I'll try to help :)

regards,
sharat87
Feb 27 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.