Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Clicking on Confirmation Button (JS) using WWW::Mechanize::Firefox

by Anonymous Monk
on Feb 16, 2017 at 03:55 UTC ( [id://1182116]=note: print w/replies, xml ) Need Help??


in reply to Clicking on Confirmation Button (JS) using WWW::Mechanize::Firefox

hi,

What kind of popup is it? Is it a alert()/promp() or just html (can be reached via xpath)?

See Re: JavaScript POP up in Firefox for open with and save file dialog and https://metacpan.org/pod/distribution/WWW-Mechanize-Firefox/lib/WWW/Mechanize/Firefox/Cookbook.pod#Override-the-Javascript-alert%28%29-function

  • Comment on Re: Clicking on Confirmation Button (JS) using WWW::Mechanize::Firefox

Replies are listed 'Best First'.
Re^2: Clicking on Confirmation Button (JS) using WWW::Mechanize::Firefox
by edimusrex (Monk) on Feb 16, 2017 at 15:21 UTC
    it's a javascript popup confirm box

      What do you mean by "javascript popup confirm box"?

      Is it the kind of dialog box like the one opened by a call to the Javascript/browser alert() function or is it some HTML that asks for confirmation?

      If it is a call to alert(), then the easiest approach is to replace that confirmation button with a Javascript function that returns the result you want:

      $mech->evaluate_in_page(<<'JS'); window.alert = function(msg) { return true }; JS

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1182116]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-20 00:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found