Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Problem with WWW::Mechanize::Chrome

by ivartr (Novice)
on Nov 10, 2017 at 10:58 UTC ( #1203114=note: print w/replies, xml ) Need Help??


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

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

Replies are listed 'Best First'.
Re^3: Problem with WWW::Mechanize::Chrome
by Corion (Pope) on Nov 10, 2017 at 11:23 UTC
    [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

        Thank you for pursuing this and keeping at this!

        The error message reminds me of a bugfix where the (number of) parameters given to a callback changed with some version of AnyEvent::WebSocket, which I think I fixed already, but it seems I haven't even published the change on Github yet. Update: Now the change has been pushed.

        In any case this sounds like a bug in my codebase to me, so I'll have to find out what callback is called at that place and whether my latest changes fix that. Having internal errors vanish silently is infuriating to me, and my codebase certainly shouldn't gobble up such errors.

        I've seen those other warnings, but I'm not familiar enough with Websockets to know what an empty message should be, and whether undef would be allowed there.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2018-01-18 18:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (213 votes). Check out past polls.

    Notices?