Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Access webpage

by kash650 (Novice)
on Apr 04, 2013 at 22:33 UTC ( #1027042=perlquestion: print w/replies, xml ) Need Help??
kash650 has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I've been trying for hours to see how to read the text from a webpage but can't find a proper solution. I've tried this, but it doesn't work. I just want to save the text to read it / directly read it

use IO::All; my $html < IO("hgdownload.soe.ucsc.edu/goldenpath/hg19/database:80");

Replies are listed 'Best First'.
Re: Access webpage
by marto (Bishop) on Apr 04, 2013 at 23:00 UTC

    You could use a module such as WWW::Mechanize to access the page content. Looking at the page I note that they request you download large files via FTP. If this is Bio Informatics data look into BioPerl to see if there's an simpler more perlish way to achieve your goal. Perl and Bioinformatics

Re: Access webpage
by Loops (Curate) on Apr 04, 2013 at 23:32 UTC

    Howdy, your syntax is just a little off:

    use IO::All; my $html < io->http("http://hgdownload.soe.ucsc.edu/database:80");

    Note that the "io" is in lowercase, not upper as in your example. You also need the "->http" method, and "http://" prefix in your url.

    Also, you'll have to ensure that you have the IO::All::LWP module installed.

      The original URL is mangled:
      use IO::All; my $html < io->http("http://hgdownload.soe.ucsc.edu:80/goldenpath/hg19 +/database");
      The :80 needs to be after the domain name, but is redundant. It is only needed if it is not port 80.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1027042]
Approved by marto
help
Chatterbox?
[jdporter]: I for one think it's kind of ridiculous that people can't ask - here - other people for help just because it involves monetary compensation.
[jdporter]: I think the test for whether to push it to jobs.perl.com should be strict: (a) you're looking for employment, or (b) you're looking to hire an employee or contractor.

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2017-03-23 01:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (278 votes). Check out past polls.