【问题标题】:Accept all cookies automatically in Selenium Chrome driver在 Selenium Chrome 驱动程序中自动接受所有 cookie
【发布时间】:2020-06-21 10:27:07
【问题描述】:

我在 python 中使用SeleniumChrome web driver。 我想在打开任何网站时自动接受所有 cookie 并摆脱 cookie 通知,如下所示:

Chrome 驱动程序中是否有任何选项允许这样做?

【问题讨论】:

  • 我不认为这是 chromedriver 可以直接做的任何事情,因为 cookie 横幅在每个站点上的实现方式不同,而不是与浏览器相关。您可能需要通过单击按钮来接受它们,但这将特定于您访问的每个站点

标签: python selenium cookies selenium-chromedriver


【解决方案1】:
 ChromeOptions options = new ChromeOptions();
    options.addArguments("--disable-notifications");
    options.addArguments("disable-infobars");

请用这个

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-10-20
    • 2022-01-28
    • 2017-03-10
    • 2013-04-25
    • 1970-01-01
    • 2016-06-30
    • 2017-05-01
    相关资源
    最近更新 更多