如何在使用 selenium 的程序上使用 auto-py-to-exe? - Chromedriver 路径错误
有谁知道如何在使用 selenium 的程序上使用 auto-py-to-exe ?
我已经处理这个问题几个小时了 我得到:
selenium.common.exceptions.WebDriverException: Message: 'chromedriver.exe' executable needs to be in PATH. Please see https://chromedriver.chromium.org/home
这是我的代码:
PATH = r'driver\chromedriver.exe'
op = webdriver.ChromeOptions()
op.add_argument('headless')
op.add_argument('--no-sandbox')
op.add_argument('--disable-dev-shm-usage')
global driver
driver = webdriver.Chrome(PATH, options=op)
它说 chromedriver.exe 不在路径中,但它是?我做错了什么? 我遵循了很多转移注意力的教程,但没有用,我快要为此失去理智了。
Does anyone know how I can use auto-py-to-exe on a program that uses selenium?
I've been dealing with this for a few hours,
I'm getting:
selenium.common.exceptions.WebDriverException: Message: 'chromedriver.exe' executable needs to be in PATH. Please see https://chromedriver.chromium.org/home
This is my code:
PATH = r'driver\chromedriver.exe'
op = webdriver.ChromeOptions()
op.add_argument('headless')
op.add_argument('--no-sandbox')
op.add_argument('--disable-dev-shm-usage')
global driver
driver = webdriver.Chrome(PATH, options=op)
It says the chromedriver.exe isn't in the path, but it is?? What am I doing wrong?
I've followed so many red-herring tutorials that didn't work and I'm about to lose my mind over this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因此,我必须将 chromedriver 与 .exe 文件或 C:\driver\chromedriver.exe 之类的位置放在一起,以便可以从我计算机上的任何位置访问它。
So, I had to place chromedriver with the .exe file or somewhere like C:\driver\chromedriver.exe so it could be accessible from anywhere on my computer.