Corion / WWW-Mechanize-Chrome

automate the Chrome browser

Home Page:https://metacpan.org/release/WWW-Mechanize-Chrome

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

An example from synopsis does not work

KES777 opened this issue · comments

the errors are:

Use of uninitialized value $cmd[0] in exec at /home/kes/work/projects/tucha/monkeyman/local/lib/perl5/WWW/Mechanize/Chrome.pm line 438.
Can't exec "": No such file or directory at /home/kes/work/projects/tucha/monkeyman/local/lib/perl5/WWW/Mechanize/Chrome.pm line 438.

resolved as:

my $mech = WWW::Mechanize::Chrome->new(
	headless   => 1, # otherwise, PDF printing will not work
	launch_exe => 'chromium-browser',
);

There certainly is a bug in W:M:Chrome in that it tries an empty executable name when it doesn't find the appropriate browser executable, but if you're not using Chrome but Chromium, you need to specify that explicitly, yes.

I'll leave this report open, because W:M:Chrome should provide a good error message when it doesn't find an appropriate executable at all.

Finding of the program now fixed by 23f9a95 .

Also, the module now searches for chromium-browser in addition to google-chrome when it has to search for a default