Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

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( 'http://students.yale.edu/oci/resultWindow.jsp', 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.


Comment on Re: WWW::Mechanize v.s .JSP Web Control
Download Code
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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://768106]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (15)
As of 2015-07-31 17:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (279 votes), past polls