Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: POSTing information on a web page

by tachyon-II (Chaplain)
on Jun 16, 2008 at 23:17 UTC ( [id://692398]=note: print w/replies, xml ) Need Help??


in reply to Re^2: POSTing information on a web page
in thread POSTing information on a web page

No No No. For a start modules have methods to do stuff: ie $lwp->cookie_jar->extract_cookies($response) However LWP takes care of this for you. *All you need to do is setup the cookie jar as shown*. The cookies you are sent will automatically be included in the header sent by LWP as appropriate. Note that in LWP the cookie_jar() method is actually just a reference to an HTTP::Cookies object so you can call any HTTP::Cookies method on $lwp->cookie_jar. Although you don't generally need to do it WWW::Mechanize is a subclass of LWP::UserAgent so (more or less) anything you can do with an LWP object (in terms of calling methods) you can do with your Mech object (unless that method got overridden).

If you are "stopping and starting" your program you can avoid logging in every time you run the program by saving the cookie to disk. See the docs, read them, and understand them.

Replies are listed 'Best First'.
Re^4: POSTing information on a web page
by clone4 (Sexton) on Jun 17, 2008 at 10:58 UTC
    thanks that helped the most. Sry for my 'slow' :) understanding, I'm new to all that stuff as well as perl ( even though i shouldn't use it as a excuse...)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-24 11:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found