gpt4 book ai didi

java - 启用不跟踪

转载 作者:行者123 更新时间:2023-11-30 07:05:49 24 4
gpt4 key购买 nike

有没有办法为Do not track启用“selenium”选项?使用 chromedriver?

没有command line switches似乎有帮助 this网站说该选项在使用 chromedriver 运行时被禁用,即使我的常规 Chrome 配置文件已打开它。我想使用一个临时配置文件,而不是加载我现有的配置文件。

建议?选项可以自动设置吗?

最佳答案

我想通了。这可以通过设置 Chrome preferences file 中的首选项来完成。像这样:

Map<String, Object> preferences = new HashMap<String, Object>();
ChromeOptions options = new ChromeOptions();

preferences.put("enable_do_not_track", true);
options.setExperimentalOption("prefs", preferences);

关于java - 启用不跟踪,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26319535/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com