你如何禁用“navigator.webdriver"?在铬驱动程序中? [英] How do you disable "navigator.webdriver" in chromedriver?

查看:23
本文介绍了你如何禁用“navigator.webdriver"?在铬驱动程序中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在寻找方法数小时后,我找不到任何可行的方法.

After hours of searching for methods, I was not able to find any ways that would simply work.

我能找到的唯一方法是将pageLoadingStrategy"功能值设置为eager",然后立即执行一些 javascript,以便它可以在页面呈现之前更改 navigator.webdriver 值.但是您需要在每次请求后更改该值,这并不可靠.

The only way I could find was Setting the "pageLoadingStrategy" capability value to "eager", and then immediately executing some javascript so it could change the navigator.webdriver value before the page was rendered. But then you need to change the value after every request and it's not really reliable.

在执行任何请求之前如何设置它?有flag吗?

How do you set this before executing any requests? Is there a flag?

推荐答案

看了好久的chrome源码,终于知道需要用什么flag来禁用navigator.webdriver的麻烦了.

After looking at the chrome source code for a good while, I finally figured out what flag needs to be used to disable that navigator.webdriver nuisance.

这里是启动chromedriver时需要用到的flag.它甚至完全禁止webdriver = true"出现.:)

Here is the flag that needs to be used when starting chromedriver. It completely disables "webdriver=true" from even showing up. :)

--disable-blink-features=AutomationControlled

这里还有一些可以启用/禁用的功能.

Also here's some more features that can be enabled/disabled.

功能

Enable Flag:
--enable-blink-features=example1,example2,example3

Disable Flag
--disable-blink-features=example1,example2,example3

希望这对也遇到此问题的人有所帮助.感谢观看

Hopefully this helps someone who has also come across this problem. Thanks for looking

这篇关于你如何禁用“navigator.webdriver"?在铬驱动程序中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆