frazap has asked for the wisdom of the Perl Monks concerning the following question:
The page loaded is a blank page, and not the page at the $url address ... The Log output isuse Data::Dumper; use WWW::Mechanize::Chrome; use Log::Log4perl qw(:easy); Log::Log4perl->easy_init($TRACE); my $url = "http://bcu-guides.unifr.ch/fr/subjects/ref#tabs-0"; my $mech = WWW::Mechanize::Chrome->new(); $mech->get($url); print $mech->status, "\n"; print $mech->title(), "\n"; die ( "No response : status line is ", $mech->status ) unless ( $mec +h->success );
Any idea on how to have chrome loading the page ?U:\docs\perl\zotero>get_wdata.pl 200 about:blank U:\docs\perl\zotero>get_wdata.pl 2018/03/20 11:21:33 Spawning $VAR1 = [ 'chrome', '--remote-debugging-port=9222', '--disable-gpu', 'about:blank' ]; 2018/03/20 11:21:36 Created new tab $VAR1 = { 'url' => 'about:blank', 'description' => '', 'type' => 'page', 'id' => '(F74FF8EFADCAAEAB7D6D5B4DF4F714E)', 'webSocketDebuggerUrl' => 'ws://127.0.0.1:9222/devtools/page +/(F74FF8EFADCAAEAB7D6D5B4DF4F714E)', 'devtoolsFrontendUrl' => '/devtools/inspector.html?ws=127.0. +0.1:9222/devtools/page/(F74FF8EFADCAAEAB7D6D5B4DF4F714E)', 'title' => '' }; 2018/03/20 11:21:36 Connecting to ws://127.0.0.1:9222/devtools/page/(F +74FF8EFADCAAEAB7D6D5B4DF4F714E) 2018/03/20 11:21:36 Connected 2018/03/20 11:21:36 Sent message $VAR1 = '{"params":{},"id":0,"method" +:"Page.enable"}'; 2018/03/20 11:21:36 Sent message $VAR1 = '{"id":1,"method":"Network.en +able","params":{}}'; 2018/03/20 11:21:36 Sent message $VAR1 = '{"method":"Runtime.enable"," +id":2,"params":{}}'; 2018/03/20 11:21:36 Replying to 0 $VAR1 = { 'id' => 0, 'result' => {} }; 2018/03/20 11:21:36 Replying to 1 $VAR1 = { 'result' => {}, 'id' => 1 }; 2018/03/20 11:21:36 Ignored message $VAR1 = { 'method' => 'Runtime.executionContextCreated', 'params' => { 'context' => { 'auxData' => { 'frameId' => '(F +74FF8EFADCAAEAB7D6D5B4DF4F714E)', 'isDefault' => b +less( do{\(my $o = 1)}, 'JSON::PP::Boolean' ) }, 'origin' => '://', 'id' => 1, 'name' => '' } } }; 2018/03/20 11:21:36 Replying to 2 $VAR1 = { 'result' => {}, 'id' => 2 }; 2018/03/20 11:21:36 Navigating to [about:blank] 2018/03/20 11:21:36 Sent message $VAR1 = '{"id":3,"method":"Page.navig +ate","params":{"url":"about:blank"}}'; 2018/03/20 11:21:36 Replying to 3 $VAR1 = { 'result' => { 'frameId' => '(F74FF8EFADCAAEAB7D6D5B4DF4F714E +)', 'loaderId' => '(90AA89AE5B68C5AA4E558EC1F56AE9 +7C)' }, 'id' => 3 }; 2018/03/20 11:21:36 No navigation occurred, not collecting events 2018/03/20 11:21:36 Navigating to [http://bcu-guides.unifr.ch/fr/subje +cts/ref#tabs-0] 2018/03/20 11:21:36 Sent message $VAR1 = '{"method":"Page.navigate","i +d":4,"params":{"url":"http://bcu-guides.unifr.ch/fr/subjects/ref#tabs +-0"}}'; 2018/03/20 11:21:36 Dispatching one-shot event $VAR1 = { 'params' => { 'frameId' => '(F74FF8EFADCAAEAB7D6D5B4DF4F714E +)' }, 'method' => 'Page.frameStartedLoading' }; 2018/03/20 11:21:36 Navigation started, logging 2018/03/20 11:21:36 Found frame id as (F74FF8EFADCAAEAB7D6D5B4DF4F714E +) 2018/03/20 11:21:36 Capturing events until 'Page.frameStoppedLoading' +for frame (F74FF8EFADCAAEAB7D6D5B4DF4F714E) 2018/03/20 11:21:36 Dispatching message $VAR1 = { 'params' => { 'frameId' => '(F74FF8EFADCAAEAB7D6D5B4DF4F714E +)' }, 'method' => 'Page.frameStartedLoading' }; 2018/03/20 11:21:36 Dispatching message $VAR1 = { 'params' => { 'executionContextId' => 1 }, 'method' => 'Runtime.executionContextDestroyed' }; 2018/03/20 11:21:36 Dispatching message $VAR1 = { 'params' => {}, 'method' => 'Runtime.executionContextsCleared' }; 2018/03/20 11:21:36 Dispatching message $VAR1 = { 'method' => 'Page.frameNavigated', 'params' => { 'frame' => { 'mimeType' => 'text/html', 'url' => 'about:blank', 'id' => '(F74FF8EFADCAAEAB7D6D5B4 +DF4F714E)', 'securityOrigin' => '://', 'loaderId' => '(1D0DADBEF9F01D6CF +33B616E1A598DB8)' } } }; 2018/03/20 11:21:36 Dispatching message $VAR1 = { 'params' => { 'context' => { 'id' => 2, 'name' => '', 'auxData' => { 'frameId' => '(F +74FF8EFADCAAEAB7D6D5B4DF4F714E)', 'isDefault' => b +less( do{\(my $o = 1)}, 'JSON::PP::Boolean' ) }, 'origin' => '://' } }, 'method' => 'Runtime.executionContextCreated' }; 2018/03/20 11:21:36 Dispatching message $VAR1 = { 'params' => { 'timestamp' => '1643765.185677' }, 'method' => 'Page.loadEventFired' }; 2018/03/20 11:21:36 Dispatching message $VAR1 = { 'method' => 'Page.frameStoppedLoading', 'params' => { 'frameId' => '(F74FF8EFADCAAEAB7D6D5B4DF4F714E +)' } }; 2018/03/20 11:21:36 Received final message, unwinding $VAR1 = { 'method' => 'Page.frameStoppedLoading', 'params' => { 'frameId' => '(F74FF8EFADCAAEAB7D6D5B4DF4F714E +)' } }; 2018/03/20 11:21:36 Ignored message $VAR1 = { 'params' => { 'timestamp' => '1643765.18599' }, 'method' => 'Page.domContentEventFired' }; 2018/03/20 11:21:36 Replying to 4 $VAR1 = { 'result' => { 'loaderId' => '(6775B90C0036886A177E258224CEE6 +63)', 'frameId' => '(F74FF8EFADCAAEAB7D6D5B4DF4F714E +)' }, 'id' => 4 }; 2018/03/20 11:21:36 Updated response object 200 about:blank
Thanks
F.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: WWW::Mechanize::Chrome - loads a blank page
by frazap (Monk) on Mar 23, 2018 at 11:45 UTC |