I haven't used WWW::Mechanize much, and I'm trying to get it to login to a site and make an entry. I can see that the logging on part is working fine, but there's a button that I want to click, and I'm not sure of the cleanest way to do that. Firefox's Firebug shows me that the code behind the button that I want to click looks like this:
What's a clean way to click such a button? As you can see, it doesn't have a "name" attribute, and the "button small" class applies to several buttons on the webpage, so maybe I could click the Nth "button small" (right?), but is there a cleaner way to identify the field? One which won't break if they insert another "button small" above this one, perhaps? There are also several 'type="submit"' buttons on this webpage.<button class="button small" onclick="ga('send','event', 'Add CCL Acti +vity', 'Select', 'Add to Report button in Search Results')" type="sub +mit">Add to Report</button>
I've spent quite some time looking through the documentation and examples, and I can see various ways to click buttons, but nothing stands out as ideal for my situation, so I thought I should ask for expert advice.
Thanks.
tel2
In reply to Clicking a button with WWW::Mechanize by tel2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |