[英]ImportError: cannot import name 'webdriver' from 'selenium' error using Selenium and WebDriver through Python
I wanted to code a program with selenium, so I wanted to test it but:我想用 selenium 编写一个程序,所以我想测试它,但是:
from selenium import webdriver
When Im running this program, it says:当我运行这个程序时,它说:
ImportError: cannot import name 'webdriver' from 'selenium'
This error message...此错误消息...
ImportError: cannot import name 'webdriver' from 'selenium'
...implies that there was an ImportError
when you tried to import webdriver
from the selenium
module. ...暗示当您尝试从
selenium
模块导入webdriver
时出现ImportError
。
This ImportError
is observed when you try to execute the line:当您尝试执行该行时,会观察到此
ImportError
:
from selenium import webdriver
without installing Selenium .无需安装Selenium 。
The very first step to use Selenium will be to install Selenium Python bindings using the following command:使用 Selenium 的第一步是使用以下命令安装Selenium Python 绑定:
pip install -U selenium
or upgrade Selenium Python bindings using the following command:或使用以下命令升级Selenium Python 绑定:
pip install -U selenium
You can find a couple of relevant discussions in:您可以在以下位置找到一些相关的讨论:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.