Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can i connect to a www server 1

Status
Not open for further replies.

thameema

Programmer
Jan 30, 2001
30
US
hi all,
how can i connect to a and get the content? How can i send a http request to the server?
Thanks in advance..
-Thameem
 
An example of using LWP::Simple to pull HTML and images from a URL.



#!/usr/local/bin/perl
use LWP::Simple;
$url = '$started = time;

# this will get the HTML text
$content = get($url);
print "$content\n";

# parse the IMG SRC tags from the HTML
while ($content =~ /<IMG.*?SRC=&quot;(.*?)&quot;/gis)
{
# retrieve each IMG SRC
print &quot;Getting $1\n&quot;;
get($1);
}

'hope this helps....


keep the rudder amid ship and beware the odd typo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top