2016-05-10 4 views
0

YMCAのローカルスケジュールからデータを抽出したい、データがdiv = "scheduler_here"の下にあるテーブル。このプロジェクトでは、PHP Simple HTML DOM Parserを使用しています。しかし、それはどんなデータも示していません。PHPでDOM要素にアクセスするシンプルなDOM

<?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>'; 
?> 

Output PHP

YMCA Website

答えて

0

あなたは、id属性によって取得する必要があります:

foreach($html->find('div[id=scheduler_here]') as $e) 
関連する問題