擅长:python、mysql、java
<p>Selenium和Puppeter有一些不同于非自动浏览器的浏览器配置。另外,由于一些JS函数被注入浏览器以操作元素,因此需要创建一些覆盖以避免检测。</p>
<p>有一些很好的文章解释了硒和木偶在具有检测机制的站点上运行时检测的一些要点:</p>
<p><a href="https://antoinevastel.com/bot%20detection/2018/01/17/detect-chrome-headless-v2.html" rel="nofollow noreferrer">Detecting Chrome headless, new techniques</a>-你可以用它在你的机器人上写一个防御代码</p>
<p><a href="https://intoli.com/blog/not-possible-to-block-chrome-headless/" rel="nofollow noreferrer">It is <em>not</em> possible to detect and block chrome headless</a>-以清晰、合理的方式解释JS代码可以检测由自动化软件启动的浏览器与真实浏览器之间的差异,以及如何伪造它。</p>
<p><a href="https://github.com/paulirish/headless-cat-n-mouse" rel="nofollow noreferrer">Github - headless-cat-n-mouse</a>-使用puppeter+python避免检测的示例</p>