我想从YMCA本地时间表中提取数据,数据表在div =“scheduler_here”下。对于这个项目,我正在使用PHP Simple HTML DOM Parser。但它没有显示任何数据。
<?php
// Include the library
include('simple_html_dom.php');
// Retrieve the DOM from a given URL
$html = file_get_html('http://www.activelifeadmin.com/newyork/websearch/public/index/weekview?sched=Group%20Exercise%20Schedule,Large%20Pool,Small%20Pool&branch_ids=38#/');
// Find the DIV tag with an id of "myId"
foreach($html->find('div[scheduler_here]') as $e)
echo $e->innertext . '<br>';
?>
答案 0 :(得分:0)
你需要通过id属性获取:
foreach($html->find('div[id=scheduler_here]') as $e)