wcm spint. script to log into public wifi with a script


In [1]:
import splinter

In [2]:
spb = splinter.Browser()

In [3]:
spb.visit('http://10.4.0.11/upload/custom/TE%20TAKERE/Te%20Takere%20Disclaimer.html')


---------------------------------------------------------------------------
error                                     Traceback (most recent call last)
<ipython-input-3-ade5dce5d7de> in <module>()
----> 1 spb.visit('http://10.4.0.11/upload/custom/TE%20TAKERE/Te%20Takere%20Disclaimer.html')

/usr/local/lib/python2.7/dist-packages/splinter/driver/webdriver/__init__.pyc in visit(self, url)
    172 
    173     def visit(self, url):
--> 174         self.connect(url)
    175         self.ensure_success_response()
    176         self.driver.get(url)

/usr/local/lib/python2.7/dist-packages/splinter/request_handler/request_handler.pyc in connect(self, url)
     21         if not (url.startswith("file:") or url.startswith("about:")):
     22             self.request_url = url
---> 23             self._create_connection()
     24             self._store_response()
     25             self.conn.close()

/usr/local/lib/python2.7/dist-packages/splinter/request_handler/request_handler.pyc in _create_connection(self)
     51         if self.auth:
     52             self.conn.putheader("Authorization", "Basic %s" % self.auth)
---> 53         self.conn.endheaders()
     54 
     55     def _parse_url(self):

/usr/lib/python2.7/httplib.pyc in endheaders(self, message_body)
    995         else:
    996             raise CannotSendHeader()
--> 997         self._send_output(message_body)
    998 
    999     def request(self, method, url, body=None, headers={}):

/usr/lib/python2.7/httplib.pyc in _send_output(self, message_body)
    848             msg += message_body
    849             message_body = None
--> 850         self.send(msg)
    851         if message_body is not None:
    852             #message_body was not a string (i.e. it is a file) and

/usr/lib/python2.7/httplib.pyc in send(self, data)
    810         if self.sock is None:
    811             if self.auto_open:
--> 812                 self.connect()
    813             else:
    814                 raise NotConnected()

/usr/lib/python2.7/httplib.pyc in connect(self)
    791         """Connect to the host and port specified in __init__."""
    792         self.sock = self._create_connection((self.host,self.port),
--> 793                                            self.timeout, self.source_address)
    794 
    795         if self._tunnel_host:

/usr/lib/python2.7/socket.pyc in create_connection(address, timeout, source_address)
    569 
    570     if err is not None:
--> 571         raise err
    572     else:
    573         raise error("getaddrinfo returns an empty list")

error: [Errno 110] Connection timed out

In [ ]:
but = spb.find_by_name('Login')

In [ ]:
but.click()

In [ ]: