0
,是否可以执行在远程站点上定义的javascript函数?通过使用phantomjs和or casperjs调用远程javascript函数
我在文档中看到的所有内容只是调用phantomjs和casperjs中的内建函数 有没有用phantomjs和or casperjs做到这一点?
,是否可以执行在远程站点上定义的javascript函数?通过使用phantomjs和or casperjs调用远程javascript函数
我在文档中看到的所有内容只是调用phantomjs和casperjs中的内建函数 有没有用phantomjs和or casperjs做到这一点?
使用它的代码分析功能(见documentation详细介绍),e.g:
page.evaluate(function() {
// do whatever you want, including calling any function
});
两年后我偶然发现了同样的问题。这是您正在寻找的解决方案。
page.evaluateJavaScript(function(){
javascriptFunction();
});
有与casperjs webscraping本博客文章中一个具体的例子 - http://www.subelsky.com/2012/08/webscraping-with-casperjs-and-phantomjs.html – widged