+-

参见英文答案 > Where to find geckodriver needed by Selenium Python package? 1个
我在Python中使用Selenium,我试图运行webdriver函数:
我在Python中使用Selenium,我试图运行webdriver函数:
default_browser = webdriver.Firefox()
这个例外:
WebDriverException:消息:’geckodriver’可执行文件需要在PATH中.
本网站的geckodriver:https://github.com/mozilla/geckodriver
但是如何在Ubuntu 16.04中安装并且可以解决这个问题吗?
最佳答案
以下是步骤:
>转到geckodriver releases page.为您的平台找到最新版本的驱动程序并下载它.例如:
wget https://github.com/mozilla/geckodriver/releases/download/v0.18.0/geckodriver-v0.18.0-linux64.tar.gz
>使用以下内容解压缩文件:
tar -xvzf geckodriver*
>使其可执行:
chmod +x geckodriver
>将驱动程序添加到PATH中,以便其他工具可以找到它:
export PATH=$PATH:/path-to-extracted-file/geckodriver
有很多方法可以做到这一点.以上在Ubuntu 16.10 64位上对我有用.
点击查看更多相关文章
转载注明原文:软件安装 – 如何在Ubuntu中安装geckodriver? - 乐贴网