Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: WWW::Mechanize v.s .JSP Web Control

by whakka (Hermit)
on Jun 03, 2009 at 18:21 UTC ( #768106=note: print w/replies, xml ) Need Help??

in reply to WWW::Mechanize v.s .JSP Web Control

As mentioned, you simply need to figure out what the server is doing. Live HTTP Headers is a good way.

The following just selects Accounting courses:

my $ua = WWW::Mechanize->new; my $res = $ua->post( '', Content => 'term=200901&GUPgroup=A&CourseNumber=&ProgramSubject=AC +CT&InstructorName=&timeRangeFrom=08&timeRangeTo=21&ExactWordPhrase=&y +cRules=new&distributionGroupOperator=AND&Submit.x=145&Submit.y=7' ); $ua->follow_link( tag => 'frame', name => 'resultFrame' ); $ua->follow_link( tag => 'frame', name => 'resultList' ); print $ua->content;
Now you can parse the html to get at the information; it's the second table in the body.

Replies are listed 'Best First'.
Re^2: WWW::Mechanize v.s .JSP Web Control
by uni_j (Acolyte) on Jun 03, 2009 at 19:42 UTC
    This is really helpful thanks :) I'm actually trying to get the data from the combobox that is in the jsp control (Program/subject), but the html is rendered afterwards (so my perl gets a big blank void :P). If posting all the header information verbatim will do the trick, this will be a trick I will do. Thanks whakka great reply !

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://768106]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2018-06-24 11:44 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.