Chrome 驱动程序首选项列表 - Selenium 4.0
我正在寻找等效命令,以设置Selenium中Chrome Driver的首选项。
fp = webdriver.FirefoxProfile()
fp.set_preference("browser.download.folderList", 2)
fp.set_preference("browser.download.manager.showWhenStarting", False)
fp.set_preference("browser.download.dir", os.path.abspath(folder_to_save))
fp.set_preference("browser.helperApps.neverAsk.saveToDisk",
"application/xapk-package-archive;application/vnd.android.package-
archive") # application/octet-stream;application/vnd.android.package-archive;application/zip;
opts = FirefoxOptions()
opts.add_argument("--headless")
我搜索了Selenium文档,但在某个地方迷路了,找不到有关Chrome下载文件夹的任何内容。
感谢您,谢谢!!!
I am looking for the equivalent commands to set preferences for Chrome Driver in Selenium.
fp = webdriver.FirefoxProfile()
fp.set_preference("browser.download.folderList", 2)
fp.set_preference("browser.download.manager.showWhenStarting", False)
fp.set_preference("browser.download.dir", os.path.abspath(folder_to_save))
fp.set_preference("browser.helperApps.neverAsk.saveToDisk",
"application/xapk-package-archive;application/vnd.android.package-
archive") # application/octet-stream;application/vnd.android.package-archive;application/zip;
opts = FirefoxOptions()
opts.add_argument("--headless")
I searched the Selenium Documentation but got lost there somewhere and couldnt find anything about download folders in Chrome.
Help is appreciated, thank you!!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论