Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Problem with WWW::Mechanize::Chrome

by Corion (Pope)
on Nov 09, 2017 at 20:31 UTC ( #1203080=note: print w/replies, xml ) Need Help??


in reply to Problem with WWW::Mechanize::Chrome

You need to shut down all Chrome processes on your machine or use a separate Chrome installation from the one you use yourself.

You can see more debugging information by initializing the logger with $TRACE instead of $ERROR. If WWW::Mechanize::Chrome can't connect to the Chrome port, then maybe you have a firewall or something blocking the access to Chrome? Maybe localhost is something else on your machine, like an IPv6 address?

Replies are listed 'Best First'.
Re^2: Problem with WWW::Mechanize::Chrome
by ivartr (Novice) on Nov 10, 2017 at 10:58 UTC

    I include the trace:

    2017/11/10 12:51:40 Spawning $VAR1 = [ 'google-chrome', '--remote-debugging-port=9222', '--disable-gpu', 'about:blank' ]; 2017/11/10 12:51:40 Spawned child as 6609 2017/11/10 12:51:42 Created new tab $VAR1 = { 'devtoolsFrontendUrl' => '/devtools/inspector.html?ws=127.0. +0.1:9222/devtools/page/882884f3-27b2-42f3-81b1-a80cad81d727', 'type' => 'page', 'id' => '882884f3-27b2-42f3-81b1-a80cad81d727', 'title' => '', 'webSocketDebuggerUrl' => 'ws://127.0.0.1:9222/devtools/page +/882884f3-27b2-42f3-81b1-a80cad81d727', 'description' => '', 'url' => 'about:blank' }; 2017/11/10 12:51:42 Connecting to ws://127.0.0.1:9222/devtools/page/88 +2884f3-27b2-42f3-81b1-a80cad81d727 2017/11/10 12:51:42 Connected 2017/11/10 12:51:42 Sent message $VAR1 = '{"method":"Page.enable","id" +:0,"params":{}}'; 2017/11/10 12:51:42 Sent message $VAR1 = '{"method":"Network.enable"," +id":1,"params":{}}'; 2017/11/10 12:51:42 Sent message $VAR1 = '{"method":"Runtime.enable"," +id":2,"params":{}}';

    After accessing devtools link trace sent:

    [1110/125428.096505:ERROR:devtools_http_handler.cc(365)] GetMimeType d +oesn't know mime type for: page/882884f3-27b2-42f3-81b1-a80cad81d727 +text/plain will be returned [1110/125428.111263:ERROR:devtools_http_handler.cc(365)] GetMimeType d +oesn't know mime type for: page/882884f3-27b2-42f3-81b1-a80cad81d727 +text/plain will be returned

    Ivar

      [1110/125428.096505:ERROR:devtools_http_handler.cc(365)] GetMimeType d +oesn't know mime type for: page/882884f3-27b2-42f3-81b1-a80cad81d727 +text/plain will be returned

      I've never seen this error message from Chrome, but it seems that something really weird is happening with your setup and/or your machine.

      Note that you can only access the devtools from one location, either from Perl or from within Chrome. It does not allow access from two things at once. If you open the devtools in Chrome after launching Perl, Perl will lose the access to the devtools.

        I noticed, that there is almost always an error message:
        2017/11/13 13:01:47 Too many arguments for subroutine at /usr/local/share/perl/5.22.1/AnyEvent/WebSocket/Connection.pm line 192 
        This was pointing to me that there might be some issues with Anyevent, therefore I added a line: use Mojolicious; before loading WWW::Mechanize::Chrome. It was quite success, included examples mostly work with some error messages:
        Use of uninitialized value $chunk in concatenation (.) or string at /usr/local/share/perl/5.22.1/Mojo/Asset/Memory.pm line 15.
        Mojo::Transaction::WebSocket=HASH(0x5042538) at /usr/local/share/perl/5.22.1/Chrome/DevToolsProtocol/Transport/Mojo.pm line 57.
        
        Ivar

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1203080]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2018-07-16 04:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (332 votes). Check out past polls.

    Notices?