laziness, impatience, and hubris | |
PerlMonks |
WWW::Mechanize Problemby pilgrim (Monk) |
on Oct 10, 2003 at 01:12 UTC ( [id://298151]=perlquestion: print w/replies, xml ) | Need Help?? |
pilgrim has asked for the wisdom of the Perl Monks concerning the following question:
Sorry about the vague title; I'm not sure if it's a problem with redirection, cookies, the site I'm trying to automate, or none of the above. Let me start by saying I've used WWW::Mechanize to automate two of my company's internal apps, and am trying to get it to do one now that starts with a login page. For this reason, I can't give the link it's failing on -- you wouldn't be able to access it. I've managed to reduce my script to a very simple case that still fails. The would-be working version tests for success at every step of the way. Also, the test case of submitting bogus login information works quite well -- I get a 403, and react accordingly. My simple case: The output of my simple case is either: Login failed: 500 Can't read entity body: Connection reset by peer or more commonly Login failed: 500 EOF when chunk header expected In a browser, I get redirected to a page with 3 links, and my script would follow() these if I could get past this error. The server's access.log shows me the initial GET request, a couple of 302s to the login form, the POST to the authenticator (also a 302), and then a GET of the page o' links as a 200 (about 3K of data). Why is WWW::Mechanize not getting this page? When I print the uri, I see it contains the same session information as the server logs. I don't seem to be getting a cookie, though. Is there some parameter I need to set in the new()? Thanks for any assistance (or insightful questions). I'm really stumped on this, and apparently too dense (or frustrated) to be able to access the non-login-protected XML interface with SOAP::Lite, either. I'd eventually like to learn to do that as well, since both interfaces need testing, but this seemed the more concrete problem. If it helps: This is perl, v5.8.0 built for cygwin-multi-64int I haven't tried outside cygwin. I just installed WWW::Mechanize this week. --pilgrim
Back to
Seekers of Perl Wisdom
|
|