Selenium Webdriver http.client.BadStatusLine: error '?

I am trying to get selenium webdriver to work, but even with a simple python script like this:

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

I get:

Traceback (most recent call last):
  File "test.py", line 14, in <module>
    driver.get('http://www.google.com')
  File "C:\Python34\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 207, in get
    self.execute(Command.GET, {'url': url})
  File "C:\Python34\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 193, in execute
    response = self.command_executor.execute(driver_command, params)
  File "C:\Python34\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 358, in execute
    return self._request(command_info[0], url, body=data)
  File "C:\Python34\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 389, in _request
    resp = self._conn.getresponse()
  File "C:\Python34\lib\http\client.py", line 1171, in getresponse
    response.begin()
  File "C:\Python34\lib\http\client.py", line 351, in begin
    version, status, reason = self._read_status()
  File "C:\Python34\lib\http\client.py", line 321, in _read_status
    raise BadStatusLine(line)
http.client.BadStatusLine: ''

This happens with all the scenarios I'm trying to do. Firefox will open and try to open the website, then close and then open another instance of Firefox, but this is a completely new blank page. I am currently in the latest version of everything. Firefox 31.7.0 ESR (updated according to Firefox), Selenium 2.46.0, and Python 3.4. Any help would be appreciated!

thank

+4
source share
1 answer

Use stable versions of Firefox. Version 38 should work.

0
source

All Articles