You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've just done a fresh install of Chromium and WWW-Mechanize-Chrome (from CPAN). I am testing the install with the following code:
use Log::Log4perl qw(:easy);
use WWW::Mechanize::Chrome;
Log::Log4perl->easy_init($ERROR); # Set priority of root logger to ERROR
my $mech = WWW::Mechanize::Chrome->new(
headless => 1,
launch_exe => '/usr/local/bin/chrome',
);
$mech->get('https://google.com');
print "Browser Version: ".$mech->browser_version()."\n";
I found that when I ran the above on a machine with no X server Perl would hang forever, no errors being printed.
I then tried running on a machine with a running X server, and despite "headless => 1" being set the chrome browser window would pop up, then the code would execute correctly.
Setting "headless => 0" or "headless => 1" makes no difference, in both cases the browser window pops up.
If I unset my DISPLAY variable so that the browser window cannot start then the below happens depending on the headless setting:
If "headless => 1", then the script will hang forever
If "headless => 0", then it terminates with the following error: Could not read websocket endpoint from Chrome output. Do you maybe have a non-debug instance of Chrome already running? at /usr/local/lib/perl5/site_perl/WWW/Mechanize/Chrome.pm line 1096.
With debug logging enabled, running with "headless => 1" and no X server I get the following:
Hi,
I've just done a fresh install of Chromium and WWW-Mechanize-Chrome (from CPAN). I am testing the install with the following code:
I found that when I ran the above on a machine with no X server Perl would hang forever, no errors being printed.
I then tried running on a machine with a running X server, and despite "headless => 1" being set the chrome browser window would pop up, then the code would execute correctly.
Setting "headless => 0" or "headless => 1" makes no difference, in both cases the browser window pops up.
If I unset my DISPLAY variable so that the browser window cannot start then the below happens depending on the headless setting:
Could not read websocket endpoint from Chrome output. Do you maybe have a non-debug instance of Chrome already running? at /usr/local/lib/perl5/site_perl/WWW/Mechanize/Chrome.pm line 1096.
With debug logging enabled, running with "headless => 1" and no X server I get the following:
I checked my process list and Chrome carried on running after "Connection closed" for a while, then it terminated while Perl did not.
My Chromium version: Chrome/129.0.6668.100
WWW-Mechanize-Chrome library version: 0.73
OS: FreeBSD 14.1-RELEASE-p5
Do let me know if you need any more info.
The text was updated successfully, but these errors were encountered: