Abe Timmerman > Win32-IE-Mechanize-0.009 > Win32::IE::Link

Download:
Win32-IE-Mechanize-0.009.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  8
Open  3
Stalled  2
View Bugs
Report a bug
Module Version: 0.003   Source   Latest Release: Win32-IE-Mechanize-0.009_17

NAME Win32::IE::Link ^

Win32::IE::Link - Mimic WWW::Mechanize::Link

SYNOPSIS ^

    use Win32::OLE;
    use Win32::IE::Link;

    my $agent = Win32::OLE->new( 'InternetExplorer.Application' );
    $agent->Navigate( $uri );

    # extract the links and wrap them as Win32::IE::Link
    my $doc = $agent->Document;
    my @links;
    for ( my $i=0; $i < $doc->anchors->lenght; $i++ ) {
        push @links, Win32::IE::Link->new( $doc->anchors( $i ) );
    }

    # print the information from the links:
    foreach my $link ( @links ) {
        printf "%s as %s\n", $link->url, $link->text||"";
    }

DESCRIPTION ^

The Win32::IE::Link object is a thin wrapper around the DOM-object supplied by the InternetExplorer.Application. It is implemented as a blessed reference to the Win32::OLE-DOM object.

METHODS ^

Win32::IE::Link->new( $element )

$element is Win32::OLE object with a tagName() of IFRAME, FRAME, <AREA> or <A>.

Note: Although it supports the same methods as WWW::Mechanize::Link it is a completely different implementation.

$link->url

Returns the url from the link.

$link->text

Text of the link.

$link->name

NAME attribute from the source tag, if any.

$link->tag

Tag name (either "A", "AREA", "FRAME" or "IFRAME").

$link->click

The IE link object supports its own click() method, so make it available.

COPYRIGHT AND LICENSE ^

Copyright MMIV, Abe Timmerman <abeltje@cpan.org>. All rights reserved

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.