Timboh56 has asked for the wisdom of the Perl Monks concerning the following question:

I am working on a data extraction script. It currently accesses this javascript web application (hosted on a local intranet server) and I need to be able to access the links provided. Unfortunately, the layout and the way the app is constructed makes it very difficult. I was able to navigate through many links but some are constructed like this:

<TD class=ClickMe vAlign=center>SuccessRate</TD></TR></TBODY></TABLE></TD></TR>

Now I'm using Win32::IE::Mechanize, I tried to do something like:

 my @elements = $mech->agent()->Document->getElementsByClass('ClickMe'); then I would look for that certain element in that collection of returned elements and theoretically (if it worked) do a click() on that element, but for some unknown reason, this line returns an array with nothing. Same goes with getElementsByTag, which makes no sense, because the page is littered with table /td /tr tags.

If somebody can put some sense into this, or provide an alternative method within this module, that would be greeeatly appreciated.

Replies are listed 'Best First'.
Re: Win32 IE Mechanize unclickable links
by Anonymous Monk on Jun 17, 2011 at 01:40 UTC
    but for some unknown reason, this line returns an array with nothing. Same

    Where is getElementsByClass supposed to come from?

       $mech->agent()->Document->getElementsByClass('ClickMe'); $mech is a Win32::IE::Mechanize object.

        What does the documentation say that ->getElementByClass returns? Maybe you can find the appropriate method to call in the documentation?