Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: use WWW::Mechanize or LWP to interface with WEB

by naikonta (Curate)
on Nov 16, 2007 at 04:22 UTC ( #651123=note: print w/replies, xml ) Need Help??

in reply to use WWW::Mechanize or LWP to interface with WEB

You should select the form first to work on after the get() method. Saying $mechObject->form_number(1) means that work on the form number 1, which is the only form in the HTML. The field() method works on a single field, so you have to call it twice for to fill in two fields. The click() method returns HTTP::Response object so you may interested the clicking result or the content returned by the server.
my $resp = $mechObject->click; die "Submit failed\n" if $resp->is_error; my $content = $resp->content; # do something with $content if necessary
However, if you have problem due the the JavaScript in the HTML source, check mechanize and javascript.

Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://651123]
[LanX]: maybe better /msg discipulus ?
[atcroft]: I thought I saw them on, and just wanted to let them know.
[LanX]: hmm ... or even better /msg /msg [discipulus]
LanX better!

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2018-02-24 20:39 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (311 votes). Check out past polls.