尝试使用Firefox
打开Selenium
时收到错误消息。我试过这个:
from selenium import webdriver
from selenium.webdriver.firefox.webdriver import FirefoxProfile
profile = FirefoxProfile('/home/usr/.mozilla/firefox')
driver = webdriver.Firefox(profile)
错误是:
selenium.common.exceptions.WebdriverException: Message: Can't load the
profile. Profile Dir: '...../webdriver-py-profilecopy' If you specified
a log_file in the FirefoxBinary constructor, check it for details.
答案 0 :(得分:1)
我认为您使用的是selenium 2.53.6
问题是firefox与selenium的兼容性,因为firefox> = 48需要Gecko Driver(https://github.com/mozilla/geckodriver)来在firefox上运行测试用例。或者你可以从这个链接https://ftp.mozilla.org/pub/firefox/releases/46.0.1/
将firefox降级到46 ..答案 1 :(得分:0)
尝试:
from selenium import webdriver
driver = webdriver.Firefox()
driver.get('http://google.com')