我正在尝试在Windows 10上使用selenium设置chromedriver,但是当我尝试做的时候
pip install chromedriver==2.11
我收到此错误
error: [Errno 13] Permission denied:'C:\\Users\\Administrator\\AppData\\Local\\Temp\\tmp8y9hyfk2'
----------------------------------------
Command ""c:\program files (x86)\python36-32\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\William\\AppData\\Local\\Temp\\pip-build-js539jmr\\chromedriver\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Administrator\AppData\Local\Temp\pip-i7ipagdt-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\William\AppData\Local\Temp\pip-build-js539jmr\chromedriver\
我该怎么做才能解决这个问题,因为我需要尽快为我的工作设置webdriver。在线下载给了我同样的错误。我看过了,并且我已经获得了编辑相关文件的所有许可,那么它会是什么呢?
答案 0 :(得分:0)
只需从here下载一个并在您的代码中访问它(假设您将其保存到桌面):
driver = webdriver.Chrome('C:/Users/User/Desktop/chromedriver.exe')
答案 1 :(得分:0)
Chrome webdriver(和其他几个)与Selenium一起打包。以下内容将打开Chrome窗口:
import selenium
driver = selenium.webdriver.Chrome()
您可以看到其他带有help(selenium.webdriver)
PACKAGE CONTENTS
android (package)
blackberry (package)
chrome (package)
common (package)
edge (package)
firefox (package)
ie (package)
opera (package)
phantomjs (package)
remote (package)
safari (package)
support (package)