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

查看:529
本文介绍了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?

例如webdriver插件firefox在
< html> 元素中添加了'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">...

我很困惑...为什么无法检测到webdriver?

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

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

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

这是我在浏览器中使用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天全站免登陆