Reputation: 493
I am trying to use selenium for Python and am having trouble running even a basic program just to get familiar with the selenium. For now, I am just trying to open a webpage and can't even get that to work. I know there are easier ways to launch a webpage with python, but my goal is to work with the webpage content later, so that is why I am using selenium.
from selenium import webdriver
browser = webdriver.Firefox()
browser.get("http://www.stackoverflow.com")
This results in this error message followed by launching a blank firefox window...
Traceback (most recent call last):
File "C:\Python33\Learning Python\soundcloud_play.py", line 10, in <module>
browser.get("http://www.stackoverflow.com")
File "C:\Python33\lib\site-packages\selenium-2.38.4-py3.3.egg\selenium\webdriver\remote\webdriver.py", line 176, in get
self.execute(Command.GET, {'url': url})
File "C:\Python33\lib\site-packages\selenium-2.38.4-py3.3.egg\selenium\webdriver\remote\webdriver.py", line 162, in execute
response = self.command_executor.execute(driver_command, params)
File "C:\Python33\lib\site-packages\selenium-2.38.4-py3.3.egg\selenium\webdriver\remote\remote_connection.py", line 349, in execute
return self._request(url, method=command_info[0], data=data)
File "C:\Python33\lib\site-packages\selenium-2.38.4-py3.3.egg\selenium\webdriver\remote\remote_connection.py", line 377, in _request
resp = self._conn.getresponse()
File "C:\Python33\lib\http\client.py", line 1143, in getresponse
response.begin()
File "C:\Python33\lib\http\client.py", line 354, in begin
version, status, reason = self._read_status()
File "C:\Python33\lib\http\client.py", line 324, in _read_status
raise BadStatusLine(line)
http.client.BadStatusLine: ''
I don't understand what this problem is or how to go about fixing it. I am running Windows 7, Python 3.3.2, Selenium 2.38.4, Firefox 17.0.10
Any ideas would be greatly appreciated. Thanks.
Upvotes: 1
Views: 620