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,…