首页 > 解决方案 > Selenium Chromedriver 打包到 Pyinstaller

问题描述

我无法让脚本运行,因为我不确定如何从正确的位置打开 chromedriver。

这是我从 chromedriver.exe 获得的代码行,chromedriver 与其余文件位于同一文件夹中

driver = webdriver.Chrome(executable_path='./chromedriver.exe', chrome_options=driverOptions)

不确定这是否是如何正确提供路径?

这是我为应用程序制作 exe 所运行的(chromedriver 未放置在“tk_app.py”中): pyinstaller.exe --icon=trademark_icon.ico --windowed --add-data "chromedriver.exe;." tk_app.py

标签: pythonseleniumselenium-chromedriverfilepath

解决方案


推荐阅读