【发布时间】:2020-02-06 00:44:13
【问题描述】:
我有这个代码,但它以这个错误结束......
driver = webdriver.Chrome('C:\webdrivers\chromedriver.exe')
blablabla ....
OSError: [WinError 740] The requested operation requires elevation
我对该文件夹授予了完全权限,并在 pycharm、py 文件和 chromedriver.exe 上以管理员身份运行,但没有任何效果......
- 我确实有 Windows,但我没有看到很多人在 Windows 上使用“webdriver”。也许正是因为这个?想...
- 这个“TinderBot”是因为我关注这个 youtube tut...
我的代码
from selenium import webdriver
import chromedriver_binary
driver = webdriver.Chrome('C:\webdrivers\chromedriver.exe')
driver.get("http://www.python.org")
完全错误
G:\school\Python\PJ\TinderBot\Scripts\python.exe G:/school/Python/PJ/gui/TinderBot/main.py
Traceback (most recent call last):
File "G:/school/Python/PJ/gui/TinderBot/main.py", line 31, in <module>
driver = webdriver.Chrome('C:\webdrivers\chromedriver.exe')
File "G:\school\Python\PJ\TinderBot\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in __init__
self.service.start()
File "G:\school\Python\PJ\TinderBot\lib\site-packages\selenium\webdriver\common\service.py", line 72, in start
self.process = subprocess.Popen(cmd, env=self.env,
File "C:\Users\Azoul\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\Azoul\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
OSError: [WinError 740] The requested operation requires elevation
Process finished with exit code 1
非常感谢!
【问题讨论】:
-
不要以管理员身份运行此代码
-
我还能做什么?
-
您使用哪些 chrome 和 chromedriver 版本?导致最新的稳定版本现在不兼容。
标签: python google-chrome webdriver