dharwood / trackspy

A python script using Selenium to visit webpages and see what tracking systems are present.
MIT License
0 stars 0 forks source link

Crashes on bad HTTP status #1

Open dharwood opened 11 years ago

dharwood commented 11 years ago

When the HTTP status is malformed in some way (as has happened in some popups I found during testing), the Selenium libraries for python hack up an exception. Needs to be handled, fixed, avoided, whatever.

dharwood commented 11 years ago

Excuse me, did I say the Selenium libraries? I meant the http.client module in Python 3.3.

Traceback (most recent call last): File "trackspy/trackspy.py", line 76, in driver.get(url) File "/usr/lib/python3.3/site-packages/selenium/webdriver/remote/webdriver.py", line 177, in get self.execute(Command.GET, {'url': url}) File "/usr/lib/python3.3/site-packages/selenium/webdriver/remote/webdriver.py", line 163, in execute response = self.command_executor.execute(driver_command, params) File "/usr/lib/python3.3/site-packages/selenium/webdriver/remote/remote_connection.py", line 349, in execute return self._request(url, method=command_info[0], data=data) File "/usr/lib/python3.3/site-packages/selenium/webdriver/remote/remote_connection.py", line 396, in _request response = opener.open(request) File "/usr/lib/python3.3/urllib/request.py", line 473, in open response = self._open(req, data) File "/usr/lib/python3.3/urllib/request.py", line 491, in _open '_open', req) File "/usr/lib/python3.3/urllib/request.py", line 451, in _call_chain result = func(*args) File "/usr/lib/python3.3/urllib/request.py", line 1272, in http_open return self.do_open(http.client.HTTPConnection, req) File "/usr/lib/python3.3/urllib/request.py", line 1257, in do_open r = h.getresponse() File "/usr/lib/python3.3/http/client.py", line 1143, in getresponse response.begin() File "/usr/lib/python3.3/http/client.py", line 354, in begin version, status, reason = self._read_status() File "/usr/lib/python3.3/http/client.py", line 324, in _read_status raise BadStatusLine(line) http.client.BadStatusLine: ''