Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Clicking a checkbox using www::mechanize

by nmcfarl (Pilgrim)
on May 11, 2004 at 19:47 UTC ( [id://352564]=note: print w/replies, xml ) Need Help??


in reply to Clicking a checkbox using www::mechanize

It is correct, but it won't do what you want it to do. WWW::Mechanize emulates a browser without javascript.

If you want the script to work you will need to either fake the javascript or embed JavaScript::SpiderMonkey which is almost always too much work.

Have fun! (and see this thread WWW::Mechanize and javascript)

Updated: The usage is not correct as jeffa points out. Must remember to check facts that I 'know'.

  • Comment on Re: Clicking a checkbox using www::mechanize

Replies are listed 'Best First'.
Re: Re: Clicking a checkbox using www::mechanize
by Anonymous Monk on May 11, 2004 at 20:26 UTC
    What do you mean by "fake" the javascript?

      To fake the javascript, you read it , and figure out what it does. Then do those actions in perl (or ignore them if you don't care.) In this case it might look like code that follows , but it all depends on what the javascript does.

      $agent->submit_form( form_name => 'hidden_form', fields => { 'newfield1' => 'val1', 'newfield2' => 'val2' }, );
        This is what the javascript looks like, how do you think I can fake it.
        function __doPostBack(eventTarget, eventArgument) { var theform = document.Home; theform.__EVENTTARGET.value = eventTarget; theform.__EVENTARGUMENT.value = eventArgument; theform.submit(); }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-26 08:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found