Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Fetching web page

by Ankit.11nov (Acolyte)
on Jul 23, 2009 at 09:37 UTC ( #782606=perlquestion: print w/replies, xml ) Need Help??

Ankit.11nov has asked for the wisdom of the Perl Monks concerning the following question:

Accessing web page and storing it in a File on local PC.
use strict; use warnings; use WWW::Mechanize; my $mech=WWW::Mechanize->new(); my $URL=""; $mech->get($URL); my $file=$mech->content(); open FILE_OUT , ">output.html" or die "$!"; print FILE_OUT $file; close FILE_OUT;
The above code is working fine when I am trying to access any HTTP link.
But if I am replacing the $URL variable(Line 5) with any HTTPS link(eg: it is giving the below error.

Error GETing Can't connect to logi (Bad hostname '') at line 8

Replies are listed 'Best First'.
Re: Fetching web page
by davorg (Chancellor) on Jul 23, 2009 at 09:45 UTC

    Under the covers WWW::Mechanise is using LWP to make HTTP requests. Therefore I assume that README.SSL will help solve your problem.


    See the Copyright notice on my home node.

    Perl training courses

      Both of the mentioned modules(Crypt::SSLeay/IO::Socket::SSL) are not available in the below location.
      Is there any other link from where I can get this modules.

        Sorry, I can't be any help here. I avoid Windows wherever I can and therefore know next to nothing about installing CPAN modules on it.


        See the Copyright notice on my home node.

        Perl training courses

        Looked into this link also , but here it is giving the below error. (

        ppm install x/Crypt-SSLeay
        ppm install failed: No PPD found at ypt-SSLeay

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://782606]
Approved by Corion
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2023-12-03 03:50 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (20 votes). Check out past polls.