Hey guys, trying to debug this script. It's not returning a result and I suspect it is because there is a JavaScript that executes.
I checked the header info with live headers and tried to manually post the url :
http://www.utsc.utoronto.ca/~registrar/scheduling/timetable?sess=summer&course=CSC&submit=Display+by+Discipline&course2=
But the table does not build the list.
I tried looking at the javascript and couldn't make sense of how I can trickit to work with mech.
Here is my code, I hope someone has a good idea of how I can get around this problem.
use WWW::Mechanize;
use HTML::TokeParser;
my $mech = WWW::Mechanize->new(cookie_jar => undef);
$url="http://www.utsc.utoronto.ca/~registrar/scheduling/timetable";
$prefix = "ANT";
$mech->get($url);
$mech->submit_form(
fields =>{
sess => "summer",
course => $prefix,
},
);
print $mech->content();
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.