in reply to [Solved] Checking onclick attribute of an anchor tag with WWW:::Mechanize::Firefox

I haven't used it, but reading way down in the examples in the docs, it looks like you might want the "$mech->clickables" method. It's listed near the bottom of "Form Methods"

It gives the example:
print "You could click on\n"; for my $el ($mech->clickables) { print $el->{innerHTML}, "\n"; };
  • Comment on Re: Checking onclick attribute of an anchor tag with WWW:::Mechanize::Firefox
  • Download Code

Replies are listed 'Best First'.
Re^2: Checking onclick attribute of an anchor tag with WWW:::Mechanize::Firefox
by Riales (Hermit) on Mar 05, 2012 at 10:37 UTC

    Hi, bitingduck!

    Thanks for the reply. I hadn't noticed the clickables method before so I went ahead and tried it out. Progress! Now there is something to dump when I check $link->{onclick}, but it's a blessed MozRepl::RemoteObject. It's pretty massive so I won't post it here (unless requested). I still can't figure out how to just see what the onclick attribute is though...

      I still can't figure out how to just see what the onclick attribute is though...

      Try $node->getAttribute