Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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="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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2022-07-01 19:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (102 votes). Check out past polls.

    Notices?