有没有办法阻止网站知道它们是否可见?
也许是命令行标志?我在这里检查过,但找不到任何合适的https://peter.sh/experiments/chromium-command-line-switches/。
我认为他们使用页面可见性 API:https ://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API
selenium selenium-webdriver google-chrome-headless puppeteer symfony-panther
我打开启用了 Browsec 扩展的 Chrome 浏览器的所有努力都失败了。这是我上次尝试过的 -
# Configure the necessary command-line option.
options = webdriver.ChromeOptions()
options.add_argument(r'--load-
extension=C:\Users\lap0042\AppData\Local\Google\Chrome\User
Data\Default\Extensions\omghfjlpggmjjaagoclmmobgdodcjboh')
# Initalize the driver with the appropriate options.
driver = webdriver.Chrome(chrome_options=options)
driver.get("http://stackoverflow.com")
Run Code Online (Sandbox Code Playgroud)
这会导致错误“无法从 .Manifest 文件加载扩展名丢失或无法读取”
搜索此错误后,我发现 Manifest.json 文件应重命名为 manifest.json.txt,但这样做会导致相同的错误。
任何帮助将不胜感激
python selenium google-chrome google-chrome-extension selenium-chromedriver