Firefox 52.0
selenium 3.14
geckodriver 0.11.1
python3.7
呼叫Firebox出錯
顯示
Traceback (most recent call last):
File "C:/Users/chaochao/Desktop/8-3.py", line 3, in <module>
browser = webdriver.Firefox()
File "D:\Python\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 164, in __init__
self.service.start()
File "D:\Python\lib\site-packages\selenium\webdriver\common\service.py", line 104, in start
raise WebDriverException("Can not connect to the Service %s" % self.path)
selenium.common.exceptions.WebDriverException: Message: Can not connect to the Service geckodriver
代碼:
from selenium import webdriver
browser = webdriver.Firefox()
browser.get("http://www.baidu.com")
print(browser.page_source)
browser.close()
請問怎么解決
PS:我找了hosts檔案,結果沒有127的注釋
uj5u.com熱心網友回復:
命令列ping localhost通不,不通的話關防火墻轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/87940.html
