Python 浏览器控制踩坑 -selenium
作者:互联网
sudo apt install firefox-esr
wget https://github.com/mozilla/geckodriver/releases/download/v0.29.0/geckodriver-v0.29.0-linux32.tar.gz
tar -xzvf deckodriver-v0.29.0-linux32.tar.gz
sudo cp geckodriver /usr/bin/geckodriver
注意,使用selenium中报出selenium.common.exceptions.WebDriverException: Message : ‘geckodriver’ executable needs to be in PATH是因为未安装浏览器跟geckodriver控件,按上述操作安装即可
出现selenium.common.exceptions.WebDriverException: Message : connection refused说明你下载的geckodriver不是最新版本,去github找一下最新版本就好
from selenium import webdriver
driver = webdriver.Firefox()
driver.get("https://www.baidu.com/")
Cheers
标签:浏览器,tar,Python,sudo,selenium,gz,geckodriver,v0.29 来源: https://blog.csdn.net/Elleryer/article/details/113245274