Errno Socket Error Error 10060
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow socket error 10060 windows live mail the company Business Learn more about hiring developers or posting ads with us Stack
Socket Error 10060 Ftp
Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of
Socket Error 10060 Error Number 0x800ccc0e
4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Python try/except statement for socket error Errno 10060 up vote 2 down vote favorite I have a Python
Socket Error 10060 Connection Timed Out Windows 7
2.7 script that consists of opening/scraping multiple URLs from a database and extracting some information out of the webpages. The code can take up to 8 hours to run and I am dealing with multiple websites. Every now and then (1-2 hours), I randomly get the error message IOError: [Errno socket error] [Errno 10060] while trying to open a URL IOError: [Errno socket error] [Errno 10060] A connection attempt failed because the socket error 10060 msdn connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond I tried to avoid the error by adding a 2 sec pause with time.sleep(2) between the URL opening operations but I still get the error. The error seems to be independent of the website from which I am trying to open the URL. I was looking at a way to prevent my script from crashing using a try/except statement. In the event of a socket error, the script would pause for something like 20 sec and then, retry to open the URL. If the URL opens correctly, move on with the script. I'm using urlopen() to open the URLs. python urlopen try-except share|improve this question asked Apr 22 '14 at 18:48 LaGuille 359618 1 It would be convenient if you could show your code. –ρss Apr 22 '14 at 18:49 It would be even more convenient if you showed us the specific part of the code that throws the exception. –merlin2011 Apr 22 '14 at 18:52 and if possible show the stacktrace –Xavier Combelle Apr 22 '14 at 18:52 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote accepted As your code rais
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the socket error 10060 gmail workings and policies of this site About Us Learn more about Stack socket error 10060 connection timed out smtp Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs socket error 10060 error number 0x800ccc0e outlook express Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join http://stackoverflow.com/questions/23227819/python-try-except-statement-for-socket-error-errno-10060 them; it only takes a minute: Sign up Python urlopen IOError: [Errno socket error] [Errno 10060] up vote 1 down vote favorite I'm looking to get more information about IOError: [Errno socket error] [Errno 10060] when using urlopen in Python 2.7. I am using my personal 35MB/s Internet connection (no proxy). I've been opening multiple webpages from various websites http://stackoverflow.com/questions/23004452/python-urlopen-ioerror-errno-socket-error-errno-10060 using a Python script and randomly get this error message from time to time: webpage = urlopen('http://www.thewebpage.com') IOError: [Errno socket error] [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond This error appeared after trying to open pages from different websites. Therefore, it doesn't seem to be related exclusively to the opening of pages from one particular website. I also got this error using mechanize. My questions are : Is this error related to the fact that I am sending multiple requests to the same server within a short amount of time? Would a time-out reduces the chance of getting this error? Is there any way to prevent it? Could I use a conditional statement to prevent the script from crashing? My script takes around an hour to run and having to rerun it due to this error is fairly unpleasant. python sockets urlopen share|improve this question asked Apr 11 '14 at 5:48 LaGuille
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn http://stackoverflow.com/questions/35350276/socket-error-error-10060/35350380 more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Socket.error [Error 10060] up vote 0 down vote favorite socket error This is the code I am trying to run. But the program produces a socket.error. I have a network proxy with port 8080 which connects me to the Internet, what more details do I have to add here to create this socket connection? import socket mysock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) mysock.connect(('www.pythonlearn.com', 80)) mysock.send('GET http://www.pythonlearn.com/code/intro-short.txt HTTP/1.0\n\n') while True: data = mysock.recv(512) if ( len(data) < 1 ) : break print socket error 10060 data; mysock.close() python python-2.7 sockets share|improve this question asked Feb 11 at 21:22 Hilal Faiz 84 You have to connect to the proxy (mysock.connect(('localhost', 8080))). The proxy then will take care of connecting to www.pythonlearn.com:80 –Andrea Corbellini Feb 11 at 22:59 I tried to connect to the proxy by importing the socks library but I get redirected to a McAfee gateway link. It is probably because of the network's security measures, what should I do? –Hilal Faiz Feb 12 at 21:37 You should read the documentation for the proxy server, or contact support (if customer support is an option) –Andrea Corbellini Feb 12 at 23:13 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote If I run your code I get the error TypeError: a bytes-like object is required, not 'str' from line 5. Try using: mysock.send(b'GET http://www.pythonlearn.com/code/intro-short.txt HTTP/1.0\n\n') with the b before your string indicating a bytestring. share|improve this answer answered Feb 11 at 21:27 bastelflp 1,4311629 The socket.error is still there. –Hilal Faiz Feb 11 at 21:39 Try using socks to get through the proxy as given in this answer. –bastelflp Feb 11 at