我也曾将Chromedriver打包到我的exe包中,但正如人们所说,它经常发生变化。
因此,我尝试使用自动检查update方法,它在IDE中也像梦一样工作,但是当我使用Pyinstaller方法将代码编译为exe文件时,它就会掉下来,并且不再将更新下载到我的temp位置,在那里,我将为我的程序的剩余部分执行驱动程序。
这会是窗口吗?它现在是在一个exe文件中,如何阻止这种请求?
就像这里的更新一样,这可能是因为我不确定自动约会器提取新的色度驱动器的位置,有人知道更新时驱动程序将放在哪里吗?
发布于 2021-02-09 03:08:26
有一个叫做chromedriver-autoinstaller的python。它可以用于自动更新色度驱动程序,您可以使用pip install chromedriver-autoinstaller命令来安装它.
import chromedriver_autoinstaller
chromedriver_autoinstaller.install() # Check if the current version of chromedriver exists
# and if it doesn't exist, download it automatically,
# then add chromedriver to path发布于 2021-10-02 14:02:07
webdriver-auto-update
PyPI和GitHub中有一个名为webdriver-auto-update的包,您可以使用它来实现自动下载铬驱动程序的简单和有效的方法。
程序功能
Installation:确保在您的系统中安装了Python。在终端中运行以下命令来安装:pip install webdriver-auto-update
示例
from selenium import webdriver
from webdriver_auto_update import check_driver
# Pass in the folder used for storing/downloading chromedriver
check_driver('folder/path/of/your/chromedriver')
driver = webdriver.Chrome()
driver.get("http://www.python.org")参考链接:
https://pypi.org/project/webdriver-auto-update/ https://github.com/competencytestlvl/webdriver_auto_update
https://stackoverflow.com/questions/66018451
复制相似问题