我需要知道我的流星应用程序是否已使用Spidered包执行过。理想情况下,应具有一个环境变量,例如“ isSpiderable”(布尔值)。
谢谢 :-)
可抓取的程序包通过在PhantomJS进程内执行应用程序客户端代码来工作,因此您可以针对用户代理签名中是否存在PhantomJS占用空间进行测试。
function isSpiderable(){
return /PhantomJS/.test(window.navigator.userAgent);
}
也可以看看这篇文章:http : //engineering.shapesecurity.com/2015/01/detecting-phantomjs-based-visitors.html
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句