Hello Monks!

I can't seem to get to the shopping list page of OOM. 'http://outofmilk.com/ShoppingList.aspx?signin=1'

I've tried a 1000 variations (witness all the sloppy commented code). I can't seem to get past the login page.

When I use the chrome debugger it looks like the POST is executing a GET to get to the shopping list page.

Could not figure out how to do that.

Sorry about the lengthy code, but I wanted to show some of what I tried.</p

I have very little experience with web apps. Please help! Thanks!

#!/usr/bin/env perl use strict; use warnings; use Data::Dumper; use LWP; use WWW::Mechanize; use Data::Printer colored => 1; my $username = 'email'; my $password = 'password'; my $url = 'https://outofmilk.com'; my $list_url = 'http://outofmilk.com/ShoppingList.aspx?signin=1'; my $mech = WWW::Mechanize->new( autocheck => 0, timeout => 30, ); $mech->agent( "Mozilla/5.0 (Windows NT 6.1)" ); $mech->credentials( $username, $password ); $mech->get($url); print Dumper( $mech->title ); p $mech->response->status_line; my $current = $mech->current_form(); #print Dumper($current); $mech->set_visible( $username, $password ); p $mech->response->status_line; $mech->submit(); p $mech->response->status_line; #print Dumper( $mech->title ); #exit; $mech->get($list_url); p $mech->response->status_line; print Dumper( $mech->title ); #exit; =pod my $result = $mech->submit_form( form_number => 1, fields => { 'id_login-email' => $username, 'id_login-password' => $password, }, ); print $result->content(); =cut # exit; $mech->field( 'login-email' => $username ); $mech->field( 'login-password' => $password ); $mech->submit(); p $mech->response->status_line; exit; p $mech->title; p $mech->res->request->as_string; exit; p $mech->content(); p $mech->res->request->as_string;

In reply to Out of milk website via WWW::Mechanize by bigswifty00000

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.