when I run it everything looks good except that this is wat I'm getting from the dump_text method.use strict; use warnings; use WWW::Mechanize; use HTTP::Cookies; my $url = 'http://emma.msrb.org/MarketActivity/RecentTrades.aspx'; my $cookies = HTTP::Cookies->new( file => "cookies.dat",autosave => 1, + ignore_discard => 1 ); my $mech = WWW::Mechanize->new( cookie_jar => $cookies ); $mech->proxy(['http'], 'http://http.proxy.fmr.com:8000'); my $response = $mech->get($url); $cookies->save( "cookies.dat"); if ($mech->success()){ print "Successful Connection\n"; } else { print "Not a successful connection\n"; } my ($button) = $mech->find_all_inputs( type => 'image', name_regex => qr/yesButton$/, ); print("button = $button->{name}\n"); if (defined $button) { print "clicking button...\n"; $mech->click($button->{name}); $cookies->save( "cookies.dat"); $mech->dump_text; }
Object movedHTTP/1.1 302 Found Date: Fri, 19 Jul 2013 20:03:11 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET X-AspNet-Version: 4.0.30319 Location: http://emma.msrb.org/MarketActivity/RecentTrades.aspx Cache-Control: private Content-Type: text/html; charset=utf-8 Content-Length: 170 Connection: close Set-Cookie: Disclaimer=Ratings; expires=Thu, 19-Jul-2063 20:03:11 GMT; path=/ Object moved to here.
and nothing is getting into the cookies.dat file besides #LWP-Cookies-1.0 Frustating. I thought maybe I should call the get method again but that does nothing different. I'm sure I'm just missing something and again thanks so much for your help.In reply to Re^2: Getting data from an ASPX generated web page
by billycote
in thread Getting data from an ASPX generated web page
by billycote
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |