There is a onclick function tied up with this tag. I need to trigger this onclick function, so I used
page.sendEvent('click', element.offsetLeft, element.offsetTop, 'left');
But it seems not working. How to make a click on tag? Thanks for any help!
答案 0 :(得分:0)
您可以通过
包含jquerypage.includeJs('http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js', callback_function);
更多信息:http://phantomjs.org/api/webpage/method/include-js.html
然后使用jQuery并从回调函数
执行page.evaluate(function(){
$('#mylink').trigger('click');
});