Last week I created and ran a test script
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Firefox()
driver.get("http://www.python.org")
client = "Python"
if client not in driver.current_url:
print("Wrong Client")
else:
print("Continue")
Which was working fine, opening a firefox window and navigating to Python.org
Today I have ran both my script and the test one and there I get a timeout error, which means that there is no navigation.
I have tried opening the webpage using
driver = webdriver.Firefox()
and then manually opening Python.org and then running a test
client = "Python"
if client not in driver.current_url:
print("Wrong Client")
else:
print("Continue")
I get an error saying driver not defined, However I had tested this last week and it worked fine.
I am not sure why I am not being able to navigate as the commands have not changed from the script that previously worked.
Below error message from Python
WebDriverException Traceback (most recent call last) in () 2 from selenium.webdriver.common.keys import Keys 3 ----> 4 driver = webdriver.Firefox() 5 driver.get("http://www.python.org") 6 assert "Python" in driver.title
C:\Users\bca\AppData\Local\Continuum\Anaconda3\lib\site-packages\selenium\webdriver\firefox\webdriver.py in init(self, firefox_profile, firefox_binary, timeout, capabilities, proxy, executable_path, firefox_options) 78 79 executor = ExtensionConnection("127.0.0.1", self.profile, ---> 80 self.binary, timeout) 81 RemoteWebDriver.init( 82 self,
C:\Users\bca\AppData\Local\Continuum\Anaconda3\lib\site-packages\selenium\webdriver\firefox\extension_connection.py in init(self, host, firefox_profile, firefox_binary, timeout) 50 self.profile.add_extension() 51 ---> 52 self.binary.launch_browser(self.profile, timeout=timeout) 53 _URL = "http://%s:%d/hub" % (HOST, PORT) 54 RemoteConnection.init(
C:\Users\bca\AppData\Local\Continuum\Anaconda3\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py in launch_browser(self, profile, timeout) 66 67 self._start_from_profile_path(self.profile.path) ---> 68 self._wait_until_connectable(timeout=timeout) 69 70 def kill(self):
C:\Users\bca\AppData\Local\Continuum\Anaconda3\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py in _wait_until_connectable(self, timeout) 106
"Dir: %s If you specified a log_file in the " 107
"FirefoxBinary constructor, check it for details." --> 108 % (self.profile.path)) 109 count += 1 110 time.sleep(1)WebDriverException: Message: Can't load the profile. Profile Dir: C:\Users\bca\AppData\Local\Temp\tmpzejv0ejm If you specified a log_file in the FirefoxBinary constructor, check it for details.