http://www.perlmonks.org?node_id=897440

hesco has asked for the wisdom of the Perl Monks concerning the following question:

Hoping to get some clarity on a question I posed here a couple of days ago (and for which I still seek guidance), I spent some time making HTTP::Recorder work. But my http://http-recorder, refuses to connect directly to the form I'm interested in, on reload from that crashed tab it redirects to a page where I am logged in, but several clicks away from the target page I need to study, hopefully with a little help. As I make my way there, inside the http-recorder page, I find myself redirected and connecting directly, with nothing being recorded, and by the time I make it to my page, it gives me a wsod.

So I turned off javascript and java in the browser, and although I retested it with a page which I know not to rely on any javascript (I wrote it), still nothing. It won't let me get as far as watching it uncheck the checkboxes.

Truth is I'd be happy to give up on making HTTP::Recorder work right now if I had some other strategy for unclicking these checkboxes. I'm guessing that having these checkboxes named as newsletters[17], which those square brackets is not making this any easier and I wonder if I need to escape them somehow.

But in the mean time, it seems I'm seeking help with either or both issues, one related to HTTP::Recorder, and another more directly with WWW::Mechanize. Any help would be appreciated.

And I wonder what dependency I might be missing to get these no such method errors looking for ->query_param().

My proxy ought to look familiar to anyone who has read the perldoc and reads like this:

#!/usr/bin/perl use HTTP::Proxy; use HTTP::Recorder; my $proxy = HTTP::Proxy->new( port => 3128 ); my $agent = new HTTP::Recorder; $agent->file("/tmp/myfile"); $proxy->agent( $agent ); $proxy->start(); 1;
These lines are representative of the errors I'm seeing on the cli:

Can't locate object method "query_param" via package "goog-malware-sha +var;a:28110-35247:s:40850-47742:mac goog-phish-shavar;a:130797-135112:s:67196-68895:mac " (perhaps you forgot to load "goog-malware-shavar;a:28110-35247:s:408 +50-47742:mac goog-phish-shavar;a:130797-135112:s:67196-68895:mac "?) at /usr/local/share/perl/5.10.0/HTTP/Recorder.pm line 347. [Mon Apr 4 22:14:13 2011] (17230) ERROR: Getting request failed: Clie +nt closed [Mon Apr 4 22:24:00 2011] (17323) ERROR: Getting request failed: sysr +ead: Connection reset by peer Can't locate object method "query_param" via package "rec-action=submi +tform&rec-formname=&rec-formnumber=2&rec-https=1&rec-form2-text-keys= +1&keys=hesco-test2&rec-form2-submit-op=1&op=Search&rec-form2-hidden-f +orm_build_id=1&form_build_id=form-6d45e9ace1a3033599dabedd422d983a&re +c-form2-hidden-form_token=1&form_token=2658acbbc0de3c846c50d584148250 +68&rec-form2-hidden-form_id=1&form_id=search_form" (perhaps you forgo +t to load "rec-action=submitform&rec-formname=&rec-formnumber=2&rec-h +ttps=1&rec-form2-text-keys=1&keys=hesco-test2&rec-form2-submit-op=1&o +p=Search&rec-form2-hidden-form_build_id=1&form_build_id=form-6d45e9ac +e1a3033599dabedd422d983a&rec-form2-hidden-form_token=1&form_token=265 +8acbbc0de3c846c50d58414825068&rec-form2-hidden-form_id=1&form_id=sear +ch_form"?) at /usr/local/share/perl/5.10.0/HTTP/Recorder.pm line 347. Can't call method "query_param" without a package or object reference +at /usr/local/share/perl/5.10.0/HTTP/Recorder.pm line 347. Use of uninitialized value $args{"value"} in substitution (s///) at /u +sr/local/share/perl/5.10.0/HTTP/Recorder/Logger.pm line 171. Use of uninitialized value $args{"value"} in concatenation (.) or stri +ng at /usr/local/share/perl/5.10.0/HTTP/Recorder/Logger.pm line 173. Use of uninitialized value $args{"value"} in substitution (s///) at /u +sr/local/share/perl/5.10.0/HTTP/Recorder/Logger.pm line 171. Use of uninitialized value $args{"value"} in concatenation (.) or stri +ng at /usr/local/share/perl/5.10.0/HTTP/Recorder/Logger.pm line 173.
if( $lal && $lol ) { $life++; }
if( $insurance->rationing() ) { $people->die(); }

Replies are listed 'Best First'.
Re: HTTP::Recorder proxy crashing on its way to my target page
by Anonymous Monk on Apr 05, 2011 at 06:48 UTC
    Hoping to get some clarity on a question I posed here a couple of days ago (and for which I still seek guidance)

    So have you read Re^5: WWW::Mechanize clicking checkboxes?

    And I wonder what dependency I might be missing to get these no such method errors looking for ->query_param().

    If you were missing one there would be a different error message, and it would have shown up during 'make test' -- its likely a bug (something to do with googles malware api and URI::QueryParam)

Re: HTTP::Recorder proxy crashing on its way to my target page
by hesco (Deacon) on Apr 05, 2011 at 12:43 UTC
    Indeed, I did review that link, and others in that thread. I tested the syntax it suggested for my task and found that it also did not produce the result I sought. That is why I turned my attention to ::Recorder.

    -- Hugh

    if( $lal && $lol ) { $life++; }
    if( $insurance->rationing() ) { $people->die(); }
      Indeed, I did review that link, and others in that thread. I tested the syntax it suggested for my task and found that it also did not produce the result I sought.

      Forget the syntaxt, get the program, modify it, then post the new program here and explain how the results are undesirable.

      Its basic How do I post a question effectively?, input, output, reproducible error :)

      Oh, not sure why you replied to yourself :) I'm's mee