[Buffalo-pm] LWP help request
rjraux at cse.Buffalo.EDU
Thu Jul 31 11:47:36 CDT 2003
I threw together a brief little example of using WWW::Mechanize to get
right into your minutes. All you need to do is regex the actual data out
of the page... perhaps taking a look at HTML::TokeParse.
Any questions, feel free to ask.
---- CUT -----
my $PHONE = '5555555555';
my $PASS = 'iamgod';
my $agent = WWW::Mechanize->new();
$agent->follow_link( url =>
#this will print you the page you want,
#now you just need to get the data in a form you want... regex?
On Thu, 31 Jul 2003, Jason Parker-Burlingham wrote:
> Jesse L Farinacci <jlf27 at cse.Buffalo.EDU> writes:
> > my $url = 'https://manage1.sprintpcs.com/Manage?target=MyCurrentUsage&action=current_usage';
> > my $ua = LWP::UserAgent->new;
> > my $req = HTTP::Request->new(GET => $url);
> > $req->authorization_basic(PHONE_NBR, PASSWORD);
> > my $res = $ua->request($req);
> I think I *do* remember some problems getting basic authorization
> working over HTTPS some years ago when I was working on a HotMail
> harvester. Sadly I seem to have deleted that project.
> > i've got the LWP with SSL properly configured, i've tested this out with
> > other https pages and it's working fine.
> I assume the other pages don't use basic authorization? Could you set
> up a small test area to work with?
> > i'm not sure if it is even possible for me to POST to the main page,
> > then while still within that UserAgent to request the usage page ::
> > perhaps the uname / pword authentication will have passed from the
> > POST and remain within the context of the UA?? maybe i'm grasping
> > at straws..
> You *may* want to have a look at the WWW::Mechanize::Shell module from
> CPAN. I've been toying with it for the last few hours and have been
> having pretty good success, although... Well. Here's the problem:
> henry at freezer:henry $ perl -MWWW::Mechanize::Shell -eshell
> Module File::Modified not found. Automatic reloading disabled.
> >get http://heavens-above.com/
> Retrieving http://heavens-above.com/(200)
>  Return to main menu page
>  Advertisement
>  here
>  here
>  log-on
>  Register
>  Select
>  Enter
>  Chris Peat
>  FAQ
>  GSOC Home Page
> http://heavens-above.com/>open 4
> Form 
> POST http://heavens-above.com/processlogon.asp
> UserName=<UNDEF> (textbox)
> Password= (password)
> Remember=<UNDEF> (checkbox) [*<UNDEF>|1]
> <NONAME>=Submit (submit)
> (textbox)UserName>  nooks
> (password)Password>  NotMyPassword
> (checkbox)Remember>  1
> For some reason trying to set the UserName parameter doesn't seem to
> be sent to the server correctly. But this sounds like a pretty bad
> failure of WWW::Mechanize::Shell. I'm checking the module is properly
> installed now but I wonder if any list members have ideas?
> Stay up-to-date on what I'm doing lately:
> Buffalo-pm mailing list
> Buffalo-pm at mail.pm.org
More information about the Buffalo-pm