How to execute function in phantomjs asynchronously

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



How to execute function in phantomjs asynchronously



I am unable to get console messaged logged inside page.evaluateAsync method.


page.evaluateAsync


page.onConsoleMessage = function(msg)
console.log('The web page said: ' + msg);
;


page.open('/Users/somenamr/Desktop/test/test.html', function(status)
if (status == 'success')

page.evaluateAsync(function()
console.log('This is not getting logged. Hi! I'm evaluateAsync call!');
, 1000);

var html = page.evaluate(function(s)

window.console.log = function(msg) alert(msg) ;
function doProcessingOnWebPage(node)

console.log("this i am getting");
););



Whereas i am getting logs which are inside the page.evaluate method.
page. evaluateAsync is getting executed byphantomjs or not?
If not is there any other way to call functions asynchronously?
I have also tried setTimeout but no logs from it also coming.





Getting them logged to which console, that of the headless browser?
– Bergi
Aug 10 at 12:38





yes, I am calling phantomjs exe as out proc . I have also set up page.onConsoleMessage = function(msg) console.log('The web page said: ' + msg); ;
– Pavan Tiwari
Aug 10 at 12:46









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard