I know how to open a page and trigger event in PhantomJS
:
var webPage = require('webpage');
var page = webPage.create();
page.open(url,status=>{
page.evaluate(function() {
var e = new MouseEvent("click",{...});
document.querySelector("a.link").dispatchEvent(e);
});
});
As shown, the a.link
will be clicked, and a new page will be visited, while I wonder if I can evaluate the new page? For example, I want to make some action in the new opened page.
Is this possible?