I am trying to get the input type hidden tag values (CAS, AH, 11, etc.) along with the name attribute but all I get is a blank page upon running my PHP based parser. Anybody know what's wrong? I already checked Grabbing hidden inputs as a string (Using PHP Simple HTML DOM Parser) but it was of no help.
Block of html I need to iterate through:
<td valign="bottom" align="center">
<input type="hidden" value="CAS" name="College">
<input type="hidden" value="AH" name="Dept">
<input type="hidden" value="111" name="Course">
<input type="hidden" value="J1" name="Section">
<input type="hidden" value="" name="Subject">
<input type="hidden" value="" name="MtgDay">
<input type="hidden" value="" name="MtgTime">
My solution that displays nothing:
<?php
include('simple_html_dom.php');
$seed = 'https://www.bu.edu/link/bin/uiscgi_studentlink.pl/1346752597?ModuleName=univschr.pl&SearchOptionDesc=Class+Subject&SearchOptionCd=C&KeySem=20133&ViewSem=Fall+2012&Subject=&MtgDay=&MtgTime=';
web_scrape($seed);
function web_scrape($url)
{
$data = new simple_html_dom();
$data->load_file($url);
$nodes = $data->find("/html/body/form/center/table/tbody/tr/td[2]/input[type=hidden]");
foreach ($nodes as $node) {
$val = $node->value;
echo $val;
}
}
?>