chrome 总是在关联的应用程序中打开这些类型的链接 selenium 中缺少复选框

chrome always open these type of links in associated app checkbox is missing in selenium

当我用 python 打开 selenium 时,我找不到总是打开这些类型的链接与相关应用程序复选框了。 人们建议我使用注册表编辑器来启用它,是的,它起作用了,但是当我用我的 python 脚本再次打开 selenium 时,它不起作用!因为不起作用,我的意思是显示了复选框,但硒不再记得它了。有什么建议吗?

哦,我想我知道你的问题是什么。 selenium 不记得您更改的设置的原因是因为您没有在 python 脚本中使用相同的 chrome 配置文件。试试这个:

options = Options()
options.add_argument(r'user-data-dir=path\to\your\chrome\profile')
driver = webdriver.Chrome(executable_path=r'path\to\your\chromedriver.exe', options=options)```
If you don't know how to check your profile, go to your webbrowser and type chrome://version and scroll until you can find the profile path subheading! Cheers, and good luck.