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