bigswifty00000 has asked for the wisdom of the Perl Monks concerning the following question:
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Out of milk website via WWW::Mechanize
by LanX (Saint) on Dec 30, 2016 at 16:46 UTC | |
by bigswifty00000 (Beadle) on Dec 30, 2016 at 21:51 UTC | |
by LanX (Saint) on Dec 30, 2016 at 22:29 UTC | |
by bigswifty00000 (Beadle) on Dec 30, 2016 at 23:15 UTC | |
by LanX (Saint) on Dec 31, 2016 at 04:41 UTC | |
by bigswifty00000 (Beadle) on Dec 31, 2016 at 13:21 UTC | |
by Anonymous Monk on Dec 31, 2016 at 14:40 UTC | |
|
Re: Out of milk website via WWW::Mechanize
by thomas895 (Deacon) on Dec 30, 2016 at 20:47 UTC | |
by bigswifty00000 (Beadle) on Dec 30, 2016 at 22:00 UTC |