python - 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
解决方案
推荐阅读
- c++ - 如何测试 boost::bimap "right.find" 的结果是否被发现?
- javascript - 如何调整小型设备的引导模式(横向和纵向)
- python - 如果条件为带有数字和字符串的数组
- mininet - 使用 RYU 控制器的 SDN mininet 中的目标主机无法访问
- json - 如何将地图列表从颤振发送到 webapi
- python-3.x - 未定义符号:_ZN10tensorflow8OpKernel11TraceStringEPNS_15OpKernelContextEb
- docker - 读取和编辑 YAML 的最简单和优化的方法
- rust - 如何将生命周期限制在代码区域?
- flutter - 带有 GIF 图像的自定义进度指示器
- php - laravel 访问其他有关系的表的数组数据