I want to click the video on this page http://37.128.191.200/?640 using JavaScript but can't figure out how
document.getElementById('container').click()
does not work
I want to click the video on this page http://37.128.191.200/?640 using JavaScript but can't figure out how
document.getElementById('container').click()
does not work
use element.dispatchEvent instead. So your code could be:
var evt = document.createEvent("MouseEvents");
evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
document.getElementById('container').dispatchEvent(evt)
See more details in https://developer.mozilla.org/en/DOM/element.dispatchEvent