使用带有homewbrew的python安装selenium
我已将selenium下载到Mac上。我正在尝试使用selenium在python中运行脚本,但出现错误:使用带有homewbrew的python安装selenium,python,selenium,Python,Selenium,我已将selenium下载到Mac上。我正在尝试使用selenium在python中运行脚本,但出现错误: Traceback (most recent call last): File "selenium.py", line 3, in <module> from selenium import webdrive File "/Users/shynds23/python/selenium.py", line 3, in <module> from sel
Traceback (most recent call last):
File "selenium.py", line 3, in <module>
from selenium import webdrive
File "/Users/shynds23/python/selenium.py", line 3, in <module>
from selenium import webdriver
ImportError: cannot import name webdriver
关于如何修复它有什么想法吗?尝试使用pip下载selenium:
pip install selenium
如果计算机上未安装pip,请运行:
python get-pip.py
以下是获取pip的链接:
我运行了第一个,但没有pip,所以我运行了第二个,它给出了以下错误:python:无法打开文件“get pip.py”:[Errno 2]没有这样的文件或目录转到此链接:。向下滚动至唯一答案,然后单击提供的链接“此处”。它将下载get-pip.py。确保将其移动到安装python的目录中。然后,运行python获取pip。py@ajax1234它们甚至需要包含标题“from selenium.common.exceptions import NoSuchElementException”吗?还是“from selenium import webdriver”提供了与元素相关的错误?我不确定OP为什么包含错误,但正如您所指出的,异常包含在库本身中。我下载了pip,然后使用pip下载了selenium,但不幸的是再次出现相同的错误。。。
python get-pip.py