I have been using click()
all the time through phantomJS engine on page.evaluate()
and it works just fine. but sometimes it just doesn't work I don't know why.
for example I am trying to click the button verify here
I tried this :
page.evaluate(function() {
document.getElementById('recaptcha-verify-button').click();
});
and this :
rect = page.evaluate(function() {
return document.getElementById('recaptcha-verify-button').getBoundingClientRect();
});
console.log(rect.left + " " + rect.right);
page.sendEvent('mousemove', rect.left + rect.width / 2, rect.top + rect.height / 2);
page.sendEvent('mousedown', rect.left + rect.width / 2, rect.top + rect.height / 2);
page.sendEvent('mouseup', rect.left + rect.width / 2, rect.top + rect.height / 2)
Both did not work, There was no output after the click()
, I tried the same on chrome though and it was the same. any ideas or suggestions are appreciated.