Python Selenium getting started error

I have updated to Selenium 3. I have set gecko in PATH but continue to get the error. Firefox starts up but then no action for a few moments and Firefox closes (i assume a time out).Any incite would be greatly appreciated!

Traceback (most recent call last): File "C:UsersPaulDocumentspython seleniumpython_org_search.py", line 4, in driver = webdriver.Firefox() File "C:Python27libseleniumwebdriverfirefoxwebdriver.py", line 78, in init self.binary, timeout) File "C:Python27libseleniumwebdriverfirefoxextension_connection.py", line 49, in init self.binary.launch_browser(self.profile) File "C:Python27libseleniumwebdriverfirefoxfirefox_binary.py", line 68, in launch_browser self._wait_until_connectable() File "C:Python27libseleniumwebdriverfirefoxfirefox_binary.py", line 106, in _wait_until_connectable % (self.profile.path)) WebDriverException: Message: Can't load the profile. Profile Dir: c:userspaulappdatalocaltemptmphptyx9 If you specified a log_file in the FirefoxBinary constructor, check it for details.

EDIT:

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.clear()
elem.send_keys("pycon")
elem.send_keys(Keys.RETURN)
assert "No results found." not in driver.page_source
driver.close()
链接地址: http://www.djcxy.com/p/62762.html

上一篇: ASP.NET MVC 3.0 WebGrid

下一篇: Python Selenium入门错误