in reply to Protocol scheme 'http' is not supported
$mech->get( $uri ) returns an HTTP::Response object. Try changing
$mech->get('http://www.perlmonks.com/'); print $mech->content;
to
my $http_response_object = $mech->get('http://www.perlmonks.com/'); print $http_response_object->content;
This worked for me:
$ perl -e 'use WWW::Mechanize; my $mech = WWW::Mechanize->new; my $hro + = $mech->get(q{http://www.perlmonks.com/}); print $hro->content' | l +ess
-- Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Protocol scheme 'http' is not supported
by ggerke (Novice) on Jul 28, 2012 at 11:37 UTC | |
Thanks for the reply. Unfortunately I get the same results... $ perl -e 'use WWW::Mechanize; my $mech = WWW::Mechanize->new; my $hro= $mech->get(q{http://www.perlmonks.com/}); print $hro->content' Error GETing http://www.perlmonks.com/: Protocol scheme 'http' is not supported at -e line 1. However, oddly enough if I do the same command with sudo I get the following: $ sudo perl -e 'use WWW::Mechanize; my $mech = WWW::Mechanize->new; my $hro= $mech->get(q{http://www.perlmonks.com/}); print $hro->content' HTML::Parser object version 3.69 does not match bootstrap parameter 3.55 at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/XSLoader.pm line 94. Compilation failed in require at /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/HTML/Entities.pm line 152. Compilation failed in require at /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/HTML/TokeParser.pm line 9. BEGIN failed--compilation aborted at /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/HTML/TokeParser.pm line 9. Compilation failed in require at /usr/lib/perl5/site_perl/5.8.8/WWW/Mechanize.pm line 134. BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.8/WWW/Mechanize.pm line 134. Compilation failed in require at -e line 1. BEGIN failed--compilation aborted at -e line 1. So I checked HTML::Parser and the rest and found: $ sudo perl -MCPAN -e shell
And then looking at my @INC and doing some find'ing I'm seeing:
Does any of that give a clue as to what's going on here...? | [reply] [d/l] [select] |
by kcott (Archbishop) on Jul 28, 2012 at 17:04 UTC | |
With all the same versions you show above and in your OP, I cannot reproduce your problem. I have a newer version of Perl than you and I'm on a different architecture:
Read more... (4 kB)
I noticed a discrepancy between versions for HTML::Parser. When you used sudo (above), 3.69 was returned without error:
without sudo (below), 3.55 was returned with an error:
This sounds like two separate installations of Perl that are not in sync. I see you've added perl -V output below; what does sudo perl -V produce? -- Ken | [reply] [d/l] [select] |
by Anonymous Monk on Jul 29, 2012 at 11:59 UTC | |
but here's the sudo perl -V output: I went to see where perl is installed in my path but only found the what I was expecting to find...
| [reply] [d/l] [select] |
by Bejjan (Novice) on Jul 30, 2012 at 07:03 UTC | |
by ggerke (Novice) on Jul 30, 2012 at 16:54 UTC | |
|
Re^2: Protocol scheme 'http' is not supported
by Jessarah FL (Novice) on Mar 25, 2013 at 14:28 UTC | |
Protocol scheme 'http' is not supported I had installed libwww-perl-6.04 on perl 5.8 It was solved by installing libwww-perl-5.837 -Jess | [reply] |
by kcott (Archbishop) on Mar 25, 2013 at 18:05 UTC | |
| [reply] | |
by Anonymous Monk on Jul 04, 2013 at 11:54 UTC | |
| [reply] |