in reply to Problem with Win32 IE Mechanize

but either way, shouldn't mechanize be able to pull all links with the links() method

links() does what it is documented to do ;) as a general rule, links are <a> elements.

http://search.cpan.org/~abeltje/Win32-IE-Mechanize/lib/Win32/IE/Mechanize.pm#$self-%3E_extract_links%28%29

sub _extract_links { my $self = shift; my $doc = $self->{agent}->Document; my @links; for ( my $i = 0; $i < $doc->all->length; $i++ ) { my $obj = $doc->all( $i ); next unless $obj->tagName =~ /^(?:IFRAME|FRAME|AREA|A)$/i; next if lc $obj->tagName eq 'a' && !$obj->href; push @links, __new_link( $doc->all( $i ) ); } $self->{links} = \@links; return wantarray ? @{ $self->{links} } : $self->{links}; }

See Re: Win32::IE:: Mechanize click_button; no form and what it references.

See Re: Setting Terminal Server User Profile Settings and what it references.

See also site:perlmonks.org Win32 Mechanize

Replies are listed 'Best First'.
Re^2: Problem with Win32 IE Mechanize
by Timboh56 (Initiate) on Jun 15, 2011 at 18:08 UTC
    EDIT: OK , I used the $mech->agent()->Document->getElementbyID stuff, it seems to work, until I get to the final "link" i have to click.

    <TD class=ClickMe vAlign=center>SuccessRate</TD>

    How could I isolate this element by the text "SuccessRate"? Please note that there are many tags with the class name ClickMe.