in reply to Re: WWW::Mechanize::Chrome: Click on button not part of a form
in thread WWW::Mechanize::Chrome: Click on button not part of a form

As per Corion's reply, you can use $mech->click({ selector => '#element-id' }); and that works great.

Since I'm using pure JS/jQuery functions, I don't need or want a form in this case, as there's nothing to submit it to. I do all the logic in client-side code, then dump it off to a route on the server without ever leaving the page.

Thanks for the validator link though, that's quite handy.

Replies are listed 'Best First'.
Re^3: WWW::Mechanize::Chrome: Click on button not part of a form
by karlgoethebier (Abbot) on Dec 01, 2019 at 16:43 UTC

    He! May be it works. HTML is always good for a surprise. But the markup you supplied is not valid. You may try it yourself ibidem. I hope I don’t miss the point. Good luck and have some fun 😎

    «The Crux of the Biscuit is the Apostrophe»

    perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help