http://www.perlmonks.org?node_id=782606

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="http://in.yahoo.com/"; $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:https://login.yahoo.com/config/mail?.intl=in) it is giving the below error.

Error GETing https://login.yahoo.com/config/mail?.intl=in: Can't connect to logi n.yahoo.com:443 (Bad hostname 'login.yahoo.com') at mech.pl 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.
      http://ppm.activestate.com/PPMPackages/zips/10xx-builds-only/Windows/
      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. (http://cpan.uwinnipeg.ca/PPMPackages/10xx/)
        Command

        ppm install http://cpan.uwinnipeg.ca/PPMPackages/10 x/Crypt-SSLeay
        Error
        ppm install failed: No PPD found at http://cpan.uwinnipeg.ca/PPMPackages/10xx/C ypt-SSLeay