Thanks so much! I feel like it's almost there. Just having a bit of trouble saving the cookie. I see it but for whatever reason it's not getting saved as I think it should be Here's my code:
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; }
when I run it everything looks good except that this is wat I'm getting from the dump_text method.

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.