Phantomjs 如果存在';让';在javascript中
例如,这是html页面的源:Phantomjs 如果存在';让';在javascript中,phantomjs,casperjs,Phantomjs,Casperjs,例如,这是html页面的源:example.html <html> <head></head> <body> <script> for (let i = 0; i < 10; ++i) { } window.location = 'http://example.com'; </script> </body> </html> for(设i=0;i
example.html
<html>
<head></head>
<body>
<script>
for (let i = 0; i < 10; ++i) {
}
window.location = 'http://example.com';
</script>
</body>
</html>
for(设i=0;i<10;++i){
}
window.location=http://example.com';
执行命令打开带有casperjs
casper.start('example.html')
结果出乎我的意料casperjs
无法重定向到http://example.com
但是如果我编辑了上面的example.html
页面,将替换为for
设i=0
~~>var i=0
一切都对我有利casperjs
将被重定向到http://example.com
如何解决每个网站的这种情况?CasperJS基于PhantomJS,它在Javascript功能方面非常过时,根本不支持ES6(而let
是ES6的一项功能),而且绝对不可能多填充关键字
由于使用了PhantomJS,强烈建议使用其他工具。我建议谷歌正在积极开发,并且有很大的优势