I am having trouble with some websites, getting this error when getting almost any information:
Could not find node with given id
-32000 at /home/cmadams/perl5/lib/perl5/Chrome/DevToolsProtocol/Target.pm line 5
04
It seems somewhat hit or miss (so maybe some kind of timing issue/race condition?) and varies based on the site. For example, with Amazon, adding a sleep allows $mech->base to work, but still $mech->links fails.
Here's my test code:
#!/usr/bin/perl
use Modern::Perl;
use WWW::Mechanize::Chrome;
use Log::Log4perl qw(:easy);
Log::Log4perl->easy_init ($WARN);
my $mech = WWW::Mechanize::Chrome->new (
launch_exe => "/usr/bin/chromium-browser",
);
eval {
$mech->get ("https://amazon.com/");
$mech->sleep (1);
print $mech->base, "\n";
print $_->text . " -> " . $_->url . "\n" for $mech->links;
};
print $@ if ($@);
$mech->target->send_message ("Browser.close")->get;
sleep (1);
I am having trouble with some websites, getting this error when getting almost any information:
It seems somewhat hit or miss (so maybe some kind of timing issue/race condition?) and varies based on the site. For example, with Amazon, adding a sleep allows $mech->base to work, but still $mech->links fails.
Here's my test code: