, I'm a bit of a newbie to perl.
I am trying to use Win32::IE::Mechanize for a data extraction script. The web application it accesses uses a hefty amount of javascript and frames, and Mechanize seems to be unable to detect any of the javascript links on the app.
I was wondering whether there was any easier solution (any modules), I've tried IEautomation but that didn't work (gave me different errors)
My code is as follows, but is unable to follow the link.
use Win32::IE::Mechanize;
my $mech = Win32::IE::Mechanize->new( visible => 1);
$mech->get(URL);
sleep(3);
my @links = $mech->links();
$mech->follow_link( text => "ServiceModel");
Mechanize is unable to pull any of the links, and it @links remains uninitialized.
The link, as it appears on the web app, looks like this, and is an image
<TD class=Expander><A name=#ServiceModel><IMG id=ServiceModel onclick=compandTree(this) src="URL/images/tree.plus.gif"></A></TD>
Now I realize that my follow link method shouldn't work, because the link is an image, but either way, shouldn't mechanize be able to pull all links with the links() method, regardless of whether it is an image link, image link, etc?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.