Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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
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 cooling their heels in the Monastery: (9)
As of 2014-10-02 18:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (69 votes), past polls