Search notes:

Perl module WWW::Mechanize::Firefox

use warnings;
use strict;

use WWW::Mechanize::Firefox;

my $mech = WWW::Mechanize::Firefox->new(
  create    => 1,   # Create new tab...
  activate  => 1,   # ... and activate it.
  autoclose => 0,   # Keep tab open after perl script end.
# --------------------------------------------------------
# Name of the program if unable to connect on first try:
  launch   =>'C:\Program Files\Mozilla Firefox\firefox.exe',
);


$mech->get('http://google.com');

print "Click ok in firefox\n";

$mech->eval_in_page('window.alert("Hello Firefox")');
# print $mech->eval_in_page('typeof(alert)');

my $png = $mech->content_as_png();

my $out_file='c:\temp\google.png';

open (my $f, '>', $out_file);

binmode $f;
print $f $png and print "google png written to $out_file\n";
close $f;
Github repository PerlModules, path: /WWW/Mechanize/Firefox/script.pl

See also

WWW::Mechanize-Firefox
Perl modules.

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1741108574, '18.119.113.14', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/Perl/modules/WWW/Mechanize/Firefox/index(71): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78