tel2 has asked for the wisdom of the Perl Monks concerning the following question:
I've just run the this, code, i.e.:
If I run that from the Linux command line like this:use WWW::Mechanize::PhantomJS; my $mech = WWW::Mechanize::PhantomJS->new(); $mech->get('http://google.com'); $mech->eval_in_page('alert("Hello PhantomJS")'); my $png = $mech->content_as_png(); print $png; # I added this line so the PNG image is sent to STDOUT
perl screenshot.pl >google.pngthe resulting google.png file contains a screen shot of the google page, but there's no "Hello PhantomJS" alert on the page. Any ideas why not, and what I should do to make the output include the alert?
I'm running WWW::Mechanize::PhantomJS 0.24 and phantomjs 2.1.1.
Thanks.
tel2
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: WWW::Mechanize::PhantomJS alert not appearing in screen shot
by Corion (Patriarch) on Apr 28, 2021 at 05:57 UTC | |
by tel2 (Pilgrim) on Apr 28, 2021 at 22:29 UTC |