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

Re: Seeking assistance with WWW::Mechanize Form Submission

by Anonymous Monk
on Jan 14, 2013 at 21:55 UTC ( #1013286=note: print w/ replies, xml ) Need Help??


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

500 after submit? What is $mech->dump of the 500 error?

is JS involved?

try HTTP::Recorder, Web Testing with HTTP::Recorder )


Comment on Re: Seeking assistance with WWW::Mechanize Form Submission
Replies are listed 'Best First'.
Re^2: Seeking assistance with WWW::Mechanize Form Submission
by tspang (Initiate) on Jan 14, 2013 at 22:39 UTC
    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
      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 :)
      :) $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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2015-07-08 00:46 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 (93 votes), past polls