【发布时间】:2012-12-14 07:14:16
【问题描述】:
我写了一个网络爬虫脚本 代码是::
<?php
include_once('simple_html_dom.php');
$target_url = "http://jvlaunchcalendar.com/calendar/";
$html = new simple_html_dom();
$html->load_file($target_url);
$ret = $html->find('div[class=fc-event-inner');
//to print the caleder events similar code //works for other sites like flipcat.com
foreach($ret as $post)
{
echo $post.'<br />';
}
echo $html;// to print the calender of jvlaunchcalendar.com site
?>
此脚本适用于其他网站。 但是我想要http://jvlaunchcalendar.com/calendar/ 页面的所有日历事件,但是这个脚本不显示任何事件给空日历。 请帮我获取日历的事件。
问候。
【问题讨论】:
-
似乎不包含任何具有此类的 div。
-
加载内容后输出整个
$html,看看你会得到什么。 -
div 在那里请再次检查我已经从日历中粘贴了这个类。但是当我想获取 $html 的完整页面时,它不会显示任何日历事件为空日历。
-
所以我在说什么。从 ajax 请求加载日历。所以当你“加载”页面时它是空的。
-
您是如何知道日历事件来自 ajax 的。请告诉我任何解决方案。
标签: php web-crawler