Gossamer Forum
Home : Products : Gossamer Forum : Development, Plugins and Globals :

Using GT::HTML::LinkExtractor...

Quote Reply
Using GT::HTML::LinkExtractor...
Hi guys. I'm probably being really stupid here, but I'm just trying to figure out how to use GT::HTML::LinkExtractor. The documentation gives this as an example;

Code:
use GT::HTML::LinkExtractor;
my $extractor = new GT::HTML::LinkExtractor(
wanted_urls => [@GT::HTML::LinkExtractor::URL_ALL],
wanted_images => ['http://', 'https://'],
get_images => 1,
get_text => 1,
follow_base => 1,
base => 'http://somedomain.com'
);
$extractor->extract( $html ); # Extract from a string
$extractor->extract_from_file( "/path/to/html.htm" ); # extract from file
$extractor->extract_from_uri( "http://www.yahoo.com";, "http://www.gossamer-threads.com"; ); # extract from uri my $links = $extractor->links;

...and with the followning HTML;

Code:
<a href="http://link"; class="MyClass">text<img src="http://image"; alt="My Alt Tag">more text</a>

Code:
{
href => "http://link";,
class => "MyClass"
content => [
"text",
{
src => "http://image";,
alt => "My Alt Tag,
},
"more text"
]
}

I'm just a little concerned on how to get ALL the link results out from $link ... maybe $link->{text}[0]->{src} .. or something?

TIA

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Subject Author Views Date
Thread Using GT::HTML::LinkExtractor... Andy 2774 Aug 13, 2004, 4:11 AM
Thread Re: [Andy] Using GT::HTML::LinkExtractor...
Andy 2683 Aug 13, 2004, 11:54 PM
Thread Re: [Andy] Using GT::HTML::LinkExtractor...
Andy 2674 Aug 16, 2004, 5:58 AM
Thread Re: [Andy] Using GT::HTML::LinkExtractor...
Andy 2666 Aug 17, 2004, 12:37 AM
Post Re: [Andy] Using GT::HTML::LinkExtractor...
Andy 2640 Sep 1, 2004, 8:13 AM