Selenium Webdriver 是可检测的 [英] Selenium Webdriver is detectable

查看:20
本文介绍了Selenium Webdriver 是可检测的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我到处都读到网站不可能检测到用户正在使用 selenium webdriver...但为什么呢?

I read everywhere that it is not possible for websites to detect that a user is using a selenium webdriver... but why?

例如 firefox 中的 webdriver 插件向 元素.所以 <html>... 转到 <html webdriver="true">...

For example the webdriver plugin in firefox adds an 'webdriver attribute' to the <html> element. So the <html>... goes to <html webdriver="true">...

我很困惑...为什么无法检测到网络驱动程序?

I am confused... why it is not possible to detect the webdriver?

我写了一点 Javascript 来获取 document.outerHTML... 还有 webdriver 属性!= 检测到!?

I wrote a little Javascript to get the document.outerHTML... and there is the webdriver attribute! = detected!?

这是我在浏览器中使用 Webdriver 和不使用 Webdriver 测试的代码:

Here is my code I tested in Browser with Webdriver and without:

<html>
<head>
  <script type="text/javascript">
  <!--
    function showWindow(){
      javascript:(alert(document.documentElement.outerHTML));
    }
  //-->
  </script>
</head>
<body>
  <form>
    <input type="button" value="Show outerHTML" onclick="showWindow()">
  </form>
</body>
</html>

请谁能解释一下为什么无法检测到 Webdriver?

推荐答案

W3C 草案规范 声明在 附录 E 表明驱动程序应该提供一种机制来识别浏览器由 WebDriver 驱动的指纹.目前,没有任何实现符合规范的这一部分.Firefox 驱动程序目前最接近,向 html 标签添加了一个属性.其他浏览器的未来版本和驱动程序可能会实现符合规范的检测方法.

The W3C draft spec states in Appendix E that drivers should provide a mechanism for fingerprinting that a browser is being driven by WebDriver. At the moment, no implementations comply with this section of the spec. The Firefox driver currently comes closest, adding an attribute to the html tag. Future versions and drivers of other browsers will likely implement methods of detection in line with the specification.

这篇关于Selenium Webdriver 是可检测的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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