码迷,mamicode.com
首页 > Web开发 > 详细

nodejs phantom add click event

时间:2014-07-26 00:11:26      阅读:310      评论:0      收藏:0      [点我收藏+]

标签:os   io   re   c   cti   ar   window   js   

page.evaluate( function() {
    // find element to send click to
    var element = document.querySelector( ‘span.control.critical.closer‘ );

    // create a mouse click event
    var event = document.createEvent( ‘MouseEvents‘ );
    event.initMouseEvent( ‘click‘, true, true, window, 1, 0, 0 );

    // send click to element
    element.dispatchEvent( event );
});

nodejs phantom add click event,布布扣,bubuko.com

nodejs phantom add click event

标签:os   io   re   c   cti   ar   window   js   

原文地址:http://www.cnblogs.com/Mr-Joe/p/3868432.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!