Webmaster-Toolkit
17-08-2002, 05:44/05:44AM
Hi
I'm needing a bit of help with a certain part of a script I'm writing. The code I'm using to extract the link text of a specified web-page seems to work on most pages, but unfortunately it doesn't pick up everything when you try it out on our illustrious administrator's (;)) page - http://www.freemoneyservices.com/
The code I'm using is this (simplified a bit):
$url = (the url inputted)
$html = get($url);
# remove newlines and multiple spaces
$html =~ s/\n//g;
$html =~ s/\r//g;
$html =~ s/\s+/ /g;
# get link text from page
@links = ($html =~ m/<a[^>]*>([^<\/a]*)<\/a>/ig);
Could anyone be so kind as to point out my error, or suggest any better way?
Thanks in advance!
I'm needing a bit of help with a certain part of a script I'm writing. The code I'm using to extract the link text of a specified web-page seems to work on most pages, but unfortunately it doesn't pick up everything when you try it out on our illustrious administrator's (;)) page - http://www.freemoneyservices.com/
The code I'm using is this (simplified a bit):
$url = (the url inputted)
$html = get($url);
# remove newlines and multiple spaces
$html =~ s/\n//g;
$html =~ s/\r//g;
$html =~ s/\s+/ /g;
# get link text from page
@links = ($html =~ m/<a[^>]*>([^<\/a]*)<\/a>/ig);
Could anyone be so kind as to point out my error, or suggest any better way?
Thanks in advance!