CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Frequently Asked Questions:
How do I fetch an HTML page on the web?

 



sleuth
Enthusiast

Dec 12, 2000, 2:28 PM

Post #1 of 1 (3980 views)
How do I fetch an HTML page on the web? Can't Post

If you have the text based browser installed on your system called "lynx", you can use that like so,

$url = "http://www.perlguru.com";
$html_code = `lynx -source $url`;

Which runs a system command using those back ticks ``.

The other way, which tends to be used more often, is by using the LWP set of modules, the simplest way is by using LWP::Simple;

use LWP::Simple;
$the_html = get("http://www.perlguru.com");

# do something with $the_html

Sleuth


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives