-1

I am new to Selenium and am following the website http://selenium-python.readthedocs.org/

I tried the following bit of code which is there on the website

from selenium import webdriver
from selenium.webdriver.common.keys import Keys

driver = webdriver.Firefox()
driver.get("http://www.python.org")
assert "Python" in driver.title
elem = driver.find_element_by_name("q")
elem.send_keys("pycon")
elem.send_keys(Keys.RETURN)
assert "No results found." not in driver.page_source
driver.close()

When I run this program, a Firefox instance opens but never loads the page. check snapshot

This is what I have received in the output console

C:\Users\Gauss\Desktop>python test.py
Traceback (most recent call last):
  File "test.py", line 4, in <module>
    driver = webdriver.Firefox()
  File "D:\Python\Python35\lib\site-packages\selenium-2.50.0-py3.5.egg\selenium\webdriver\firefox\webdriver.py", line 78, in __init__
    self.binary, timeout)
  File "D:\Python\Python35\lib\site-packages\selenium-2.50.0-py3.5.egg\selenium\webdriver\firefox\extension_connection.py", line 49, in __init__
    self.binary.launch_browser(self.profile)
  File "D:\Python\Python35\lib\site-packages\selenium-2.50.0-py3.5.egg\selenium\webdriver\firefox\firefox_binary.py", line 68, in launch_browser
    self._wait_until_connectable()
  File "D:\Python\Python35\lib\site-packages\selenium-2.50.0-py3.5.egg\selenium\webdriver\firefox\firefox_binary.py", line 106, in _wait_until_connectable
% (self.profile.path))
selenium.common.exceptions.WebDriverException: Message: Can't load the profile. Profile Dir: C:\Users\Gauss\AppData\Local\Temp\tmpkpjhnhpb If you specified a log_file in the FirefoxBinary constructor, check it for details.

Could someone please suggest a solution to this issue?

Note: This issue is on my office pc and the same code works fine on my home pc. So some issue with Firefox maybe.

Gaus
  • 59
  • 1
  • 3
  • 11
  • Probable duplicate of: http://stackoverflow.com/q/6682009/954442 – Andrew Regan Feb 01 '16 at 16:27
  • this post mentions that the issue was fixed post version 2.26 but I am using 2.50 still facing this issue, I am working on Windows 10 and Firefox version is 44.0 – Gaus Feb 01 '16 at 16:36

1 Answers1

0

Based on your comments, it looks like the version of Firefox you have is not yet supported by python driver. Currently they support up to v. 38, you have 44.

timbre timbre
  • 12,648
  • 10
  • 46
  • 77
  • My home pc also has the Firefox version 44 and Selenium 2.50 but it works fine on that. Issue seems to be on my office pc. – Gaus Feb 02 '16 at 16:42