-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't locate object method "port" via package "URI::_generic" at .../perl/5.28.1/WWW/Mechanize/Chrome.pm line 1033. #61
Comments
Can you please post the version of the
Locally I have URI 5.09 and it works here. Also, what version of WWW::Mechanize::Chrome are you using? |
Hey Max, 5.09 is the version of my URI
Somehow the used Perl library - is located in /home/$USER/perl5/.. Greetings, |
These are the versions that I expect. Maybe the output of Chrome is unexpected in some way... Can you please run your test program with the logging level set to
Actually, this problem occurs (for me now too) when an instance of Chrome is still open and Chrome was not launched with the The following program creates a separate Chrome instance that does not share cookies etc. and should always start for you. I think I will have to improve the error message for when there is no #!perl
use strict;
use warnings;
use File::Temp 'tempdir';
use WWW::Mechanize::Chrome;
use Log::Log4perl ':easy';
Log::Log4perl->easy_init($TRACE);
my $tempdir = tempdir( CLEANUP => 1 );
my $mech = WWW::Mechanize::Chrome->new(
autodie => 1,
data_directory => $tempdir,
);
# I don't expect to get here...
print "Program completed OK\n"; |
I believe, we have the same output here -
Letting Perl open a fresh Chrome Session does the Trick - Maybe i'll get the Job done, though - The Open Remote Debugging Port Chrome Sessions Greetings, |
The following program works for me, connecting to a running Chrome instance (and for this test, also launching the Chrome instance): #!perl
use strict;
use warnings;
use Test::More;
use WWW::Mechanize::Chrome;
use Log::Log4perl ':easy';
Log::Log4perl->easy_init($TRACE);
# Launch our local Chromium, to get a current session
system("chromium '--remote-debugging-port=9222' '--remote-debugging-address=127.0.0.1' '--enable-automation' &"
) == 0
or die;
# Give Chrome time to start up
sleep 2;
# And now try to connect to it, without crashing
my $ok = eval {
my $mech = WWW::Mechanize::Chrome->new(
autodie => 1,
port => 9222,
);
$mech->get('https://google.com');
1;
};
my $error = $@;
is $ok, 1, "We connected to Chromium";
is $error, '', "No error while connecting";
done_testing; The trick is that the second instance needs to know the debug port used by the first instance. |
=> Can't locate object method "port" via package "URI::_generic"
at .../perl/5.28.1/WWW/Mechanize/Chrome.pm line 1033.
Is this a temporary Bug or did I just miss to install the certain module?
_Installed modules are:
Algorithm::Diff
Algorithm::Loops
App::cpanminus
CAM::PDF
CGI
Capture::Tiny
Class::Accessor
Class::Method::Modifiers
Crypt::RC4
Data::Dump
Devel::Cycle
Devel::Symdump
ExtUtils::Config
ExtUtils::Helpers
ExtUtils::InstallPaths
Filter::signatures
Font::TTF
Future
Future::HTTP
HTML::Form
HTML::Selector::XPath
HTTP::Daemon
HTTP::Request::AsCGI
HTTP::Server::Simple
IO::Async
IO::String
Image::Info
Imager
Imager::File::PNG
JSON
Log::Log4perl
MRO::Compat
Metrics::Any
Module::Build
Module::Build::Tiny
Mojolicious
Moo
Net::Async::WebSocket
Object::Import
PDF::API2
PadWalker
Path::Tiny
Perl
PerlX::Maybe
Pod::Coverage
Protocol::WebSocket
Role::Tiny
Socket
Spiffy
Struct::Dumb
Sub::Quote
Sub::Uplevel
Test::Base
Test::Deep
Test::Exception
Test::Fatal
Test::HTTP::LocalServer
Test::Identity
Test::Memory::Cycle
Test::Metrics::Any
Test::Needs
Test::NoWarnings
Test::Output
Test::Pod
Test::Pod::Coverage
Test::Refcount
Test::RequiresInternet
Test::Taint
Test::Warn
Test::Warnings
Test::Without::Module
Text::Diff
Text::Levenshtein
Text::Levenshtein::Damerau
Text::PDF
URI
URI::ws
WWW::Mechanize
WWW::Mechanize::Chrome
install
libwww::perl
local::lib
_
Greetings,
Mx
The text was updated successfully, but these errors were encountered: