Selenium不能在Python中工作,Ubuntu16.04

2024-04-20 02:34:26 发布

您现在位置:Python中文网/ 问答频道 /正文

我用pip安装了selenium。把geckodriver放在/usr/bin中。 我不断更新ubuntu。Firefox更新。在

当我运行以下程序时:

from selenium import webdriver

browser = webdriver.Firefox()
browser.get('http://google.com')

我继续跑:

最后。 回溯(最近一次呼叫): “文件”硒敏特罗.py“,第3行,英寸 从selenium import webdriver 文件“/usr/local/lib/python2.7/dist packages/selenium/webdriver/init.py”,第18行,in 从。firefox.webdriver将WebDriver导入为Firefox#noqa 文件“/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/网络驱动程序.py“,第32行,英寸 从.extension_connection导入ExtensionConnection 文件“/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/extension_连接.py“,第24行,英寸 从selenium.webdriver.remote。远程连接导入远程连接 文件“/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/remote_连接.py“,第35行,英寸 从。导入实用程序 文件“/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/实用工具.py“,第22行,英寸 导入zipfile 文件“/usr/lib/python2.7/zipfile.py文件“,第501行,英寸 类ZipExtFile(io.缓冲数据库): AttributeError:“module”对象没有属性“BufferedIOBase”


(程序已退出,代码:1) 按返回继续

为什么会这样? 谢谢您。在


Tags: 文件pyimport程序remotelibpackagesusr