简体   繁体   English

在 Selenium Chrome 驱动程序中自动接受所有 cookies

[英]Accept all cookies automatically in Selenium Chrome driver

I am using Selenium with Chrome web driver in python.我在 python 中使用SeleniumChrome web 驱动程序 I would like to automatically accept all cookies when opening any website and get rid of the cookie notification like the following:我想在打开任何网站时自动接受所有 cookies 并摆脱如下 cookie 通知:

在此处输入图像描述

Is there any option in Chrome driver that allows to do that? Chrome驱动程序中是否有任何选项可以做到这一点?

 ChromeOptions options = new ChromeOptions();
    options.addArguments("--disable-notifications");
    options.addArguments("disable-infobars");

please use this请使用这个

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM