gpt4 book ai didi

selenium - 如何检测我网站上的 selenium/webdriver 浏览

转载 作者:行者123 更新时间:2023-12-01 06:00:00 25 4
gpt4 key购买 nike

有谁知道如何检测我网站上的 selenium/webdriver 浏览?

我不想阻止它们,只是检测它们。

我看到了这个问题:
Can a website detect when you are using selenium with chromedriver?

但是在最新版本上尝试所有这些似乎都不起作用。

任何 body 都知道别的吗?

附言请不要留下“不要阻止”/“你找错地方”的答案/评论——我完全知道我在问什么以及使用它的业务逻辑是什么。

- 编辑 -

我从上面的链接测试过的东西:

  • 检测元素上的 cdc_asdjflasutopfhvcZLmcfl_ 键,主要是在窗口和文档上,但在整个站点上还有一些其他元素。
  • 搜索 window.navigator.webdriver总是返回 undefined而不是 true (在 chrome 和 firefox 上都进行了测试,虽然只有 firefox 说支持它)
  • 从这个答案中测试了脚本:https://stackoverflow.com/a/45814390/1593987

  • 所有测试均使用最新的 selenium、浏览器(firefox 和 chrome)和最新的 webdriver 插件完成。目前仅在 Windows 上,但也可能会测试 ubuntu。

    最佳答案

    在最新版本的 Selenium WebDriver 中,它在规范级别进行处理。

    有一个只读的 JS 属性 - navigator.webdriver这是 true如果使用 webdriver 来控制浏览器。

    使用 Chrome v73 检查 - 返回 true。

    enter image description here

    引用:

  • 规范 - https://w3c.github.io/webdriver/#dom-navigatorautomationinformation-webdriver
  • 火狐 - https://developer.mozilla.org/en-US/docs/Web/API/Navigator/webdriver
  • Chrome - https://www.chromestatus.com/feature/6216034532982784
  • 关于selenium - 如何检测我网站上的 selenium/webdriver 浏览,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46685331/

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