报错:raceback (most recent call last):
File "C:\Users\Administrator\Desktop\selenium\chrome.py", line 4, in <module>
driver=webdriver.Firefox()
File "C:\Python27\lib\selenium\webdriver\firefox\webdriver.py", line 59, in __init__
self.binary, timeout),
File "C:\Python27\lib\selenium\webdriver\firefox\extension_connection.py", line 47, in __init__
self.binary.launch_browser(self.profile)
File "C:\Python27\lib\selenium\webdriver\firefox\firefox_binary.py", line 66, in launch_browser
self._wait_until_connectable()
File "C:\Python27\lib\selenium\webdriver\firefox\firefox_binary.py", line 105, in _wait_until_connectable
raise WebDriverException("Can‘t load the profile. Profile "
WebDriverException: Message: Can‘t load the profile. Profile Dir: %s If you specified a log_file in the FirefoxBinary constructor, check it for details.
报错:[error] Could not connect to Selenium Server. Have you started the Selenium Server yet?
解决:启用服务java -jar C:\seleniumRC\selenium-server-1.0.3\selenium-server-standalone-2.45.0.jar
如果启用失败,查看端口netstat -ano 关闭被占用的端口。