http://php-archive.net/php/dom-scraping/
上のサイトを参考にPHPでスクレイピングの勉強をしているのですが、下記のサイトの予約状況をスクレイピングしようとするとタイトルなどは取得できるのですが、その下の方にあるテーブルタグの中がTrying to get property of non-objectというエラーでスクレイピングできません。何か特別な設定が必要なのでしょうか?
対象サイト
https://www.togakusi.com/camp/reserve/list.php
ソース
<!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <title>キャンプ予約</title> </head> <body> <a href="https://www.togakusi.com/camp/reserve/list.php">リンク</a> <?php$togakushi=new DOMDocument();
@$togakushi->loadHTMLFile('https://www.togakusi.com/camp/reserve/list.php');
$xpath=new DOMXPath($togakushi);
$tag='id("Main")/table[@class="calendar w100"]/tbody/tr[5]/td[@class="weekday"][1]';
$yoyaku=$xpath->query($tag)->item(0)->nodeValue;
echo $yoyaku;
?>
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。