Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Seeking assistance with WWW::Mechanize Form Submission

by tspang (Initiate)
on Jan 14, 2013 at 22:39 UTC ( #1013289=note: print w/ replies, xml ) Need Help??


in reply to Re: Seeking assistance with WWW::Mechanize Form Submission
in thread Seeking assistance with WWW::Mechanize Form Submission

I'll take a look at HTTP::Recorder.

There doesn't appear to be a dump method - just dump-forms, dump-images, etc. If I set autocheck to 1 and let it exit it gives me a quite generic error:

Server closed connection without sending any data back

As for javascript, the only javascript on the page sets focus to the first text field. I've included it here for completeness:
script type="text/javascript" function placeFocus() { if (document.forms.length > 0) { var field = document.forms[0]; for (i = 0; i < field.length; i++) { if ((field.elements[i].type == "text") || (field.elements[i].type == " +textarea")) { document.forms[0].elements[i].focus(); break; } } } } /script


Comment on Re^2: Seeking assistance with WWW::Mechanize Form Submission
Download Code
Re^3: Seeking assistance with WWW::Mechanize Form Submission
by Anonymous Monk on Jan 15, 2013 at 01:37 UTC
    :) $mech->res->dump

      I'm not sure what the correct method of responding to multiple comments is, so I'm going to reply to each on individually.

      I must be missing something in the documention as I'm not seeing res->dump in the mechanize doc on cpan. Anyway, here is what I get back from the dump:

      500 Server closed connection without sending any data back Content-Type: text/plain Client-Date: Tue, 15 Jan 2013 23:45:32 GMT Client-Warning: Internal response
Re^3: Seeking assistance with WWW::Mechanize Form Submission
by Anonymous Monk on Jan 15, 2013 at 01:38 UTC
    It is common for an image on the page to set a cookie, so HTTP::Recorder or LiveHttpHeaders or WireShark will show that if you're looking :)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2015-07-04 06:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (58 votes), past polls