Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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
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
      :) $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
      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://1013286]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2014-12-28 15:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (182 votes), past polls