Timeout [Errno 10060] while trying to access google

264 views
Skip to first unread message

Cássio Nandi Citadin

unread,
Nov 10, 2011, 6:59:24 AM11/10/11
to splinte...@googlegroups.com
Yes, I am back with more problems =)

Executing this code in Idle:

from splinter.browser import Browser
browser = Browser()
url = "http://www.google.com"
browser.visit(url)

The browser instance open and a couple of minutes after I have this error message:

Traceback (most recent call last):
  File "C:\Users\cassio.nandi\Desktop\splinter\exemplo.py", line 6, in <module>
    browser.visit(url)
  File "C:\Python27\lib\site-packages\splinter\driver\webdriver\__init__.py", line 66, in visit
    self.connect(url)
  File "C:\Python27\lib\site-packages\splinter\request_handler\request_handler.py", line 11, in connect
    self._create_connection()
  File "C:\Python27\lib\site-packages\splinter\request_handler\request_handler.py", line 34, in _create_connection
    self.conn.request('GET', self.path)
  File "C:\Python27\lib\httplib.py", line 955, in request
    self._send_request(method, url, body, headers)
  File "C:\Python27\lib\httplib.py", line 989, in _send_request
    self.endheaders(body)
  File "C:\Python27\lib\httplib.py", line 951, in endheaders
    self._send_output(message_body)
  File "C:\Python27\lib\httplib.py", line 811, in _send_output
    self.send(msg)
  File "C:\Python27\lib\httplib.py", line 773, in send
    self.connect()
  File "C:\Python27\lib\httplib.py", line 754, in connect
    self.timeout, self.source_address)
  File "C:\Python27\lib\socket.py", line 571, in create_connection
    raise err
error: [Errno 10060] Uma tentativa de conexão falhou porque o componente conectado não respondeu corretamente após um período de tempo ou a conexão estabelecida falhou porque o host conectado não respondeu

Any ideas?

--
Cordialmente,
   Cássio Nandi Citadin  -  cassionandi at gmail.com
    @cassionandi  -  http://cassionandi.blogspot.com
   (48) 9921-9991

Não basta ser agora, tem que ser pra Jah!

Francisco Souza

unread,
Nov 10, 2011, 7:36:36 AM11/10/11
to splinte...@googlegroups.com
On Thu, Nov 10, 2011 at 9:59 AM, Cássio Nandi Citadin <cassi...@gmail.com> wrote:
[...]

Any ideas?

Is there a proxy in your network?

--
Francisco Souza

Cássio Nandi Citadin

unread,
Nov 10, 2011, 8:29:06 AM11/10/11
to splinte...@googlegroups.com
Yes.

IE and Firefox (with profile) are configured.

2011/11/10 Francisco Souza <f...@souza.cc>

Cássio Nandi Citadin

unread,
Nov 10, 2011, 8:33:34 AM11/10/11
to splinte...@googlegroups.com
Francisco, this code works (only selenium, not splinter)

from selenium import webdriver
driver = webdriver.Firefox()
driver.get("http://www.google.com")

With splinter I got that error.

2011/11/10 Cássio Nandi Citadin <cassi...@gmail.com>

Cássio Nandi Citadin

unread,
Nov 10, 2011, 11:27:57 AM11/10/11
to splinte...@googlegroups.com
This is a semi-debug on the method that the error message point.

    def _create_connection(self):
        self._parse_url()
        self.conn = httplib.HTTPConnection(self.host, self.port)
        self.conn.request('GET', self.path)

self.host = 'www.google.com'
self.port = None
self.path = '' (empty)

Don't know if this can help.

Cássio Nandi Citadin

unread,
Nov 10, 2011, 12:52:07 PM11/10/11
to splinte...@googlegroups.com
Splinter visit command is different then get for selenium by the way.

It would be helpful if someone who understand the two tools say what is going on.

Francisco Souza

unread,
Nov 10, 2011, 1:02:07 PM11/10/11
to splinte...@googlegroups.com
On Thu, Nov 10, 2011 at 3:52 PM, Cássio Nandi Citadin <cassi...@gmail.com> wrote:
Splinter visit command is different then get for selenium by the way.

It would be helpful if someone who understand the two tools say what is going on.

Splinter uses httplib to check the status of the response before actually execute Selenium's get method, and this call doesn't work with proxy. We shall add proxy configuration on splinter itself, so splinter can use information about proxy to also proxy the httplib error checking.

I'm attaching this info to the issue #120 [1]. I can't fix it in the next days, but I hope someone will find a time and work on it :)



--
Francisco Souza

Cássio Nandi Citadin

unread,
Nov 10, 2011, 1:04:45 PM11/10/11
to splinte...@googlegroups.com
Great! Thank you for the patience and brains Francisco.

2011/11/10 Francisco Souza <f...@souza.cc>
Reply all
Reply to author
Forward
0 new messages