PhantomJS; click an element

前端 未结 11 858
借酒劲吻你
借酒劲吻你 2020-11-21 23:53

How do I click an element in PhantomJS?

page.evaluate(function() {
    document.getElementById(\'idButtonSpan\').click();  
});

This gives

11条回答
  •  梦谈多话
    2020-11-22 00:16

    I never was able to directly click the element. Instead, I looked at the html to find what function was called with onclick, and then called that function.

提交回复
热议问题