Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

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]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2019-07-21 08:29 GMT
Find Nodes?
    Voting Booth?
    If you were the first to set foot on the Moon, what would be your epigram?

    Results (7 votes). Check out past polls.