我在 http://testphp.vulnweb.com/AJAX/ 上使用casperjs scrape urls,有些网址依赖于动态点击标签,我使用casperjs动态点击标签,但点击后我无法获得动态内容标签,< / p>
page.waitFor(function check(){
return this.evaluate(function () {
var elements = __utils__.getElementsByXPath('//a[starts-with(@href, "javascript:")]');
for (var i = 0; i < elements.length; ++i) {
var e = elements[i];
event = window.__ksevent__.initMouseEvent('click');
return e.dispatchEvent(event);
}
})
}, function then(){
return this.fireEvent('click', x('//a[starts-with(@href, "javascript:")]'));
});