php curl 数据采集 空,PHP curl从网站返回空数组的数据

我想写一个PHP脚本来从www.snowbird.com/mountain-report/拉雪和其他数据通过LED阵列显示。我在获取需要的数据方面遇到麻烦。我似乎无法找到使其工作的方法。我能做这项工作吗?还是我需要去使用另一种语言?PHP curl从网站返回空数组的数据

以下代码仅返回空白。在代码之后,我会发布返回的内容。

require('simple_html_dom.php');

$ch = curl_init("http://www.snowbird.com/mountain-report/");

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);

$content = curl_exec($ch);

curl_close($ch);

$html = new simple_html_dom();

$html->load($content);

$ret1 = $html->find('.snowfall-total');

print_r ($ret1);

$ret2 = $html->find('#twenty-four-hour');

print_r ($ret2);

$ret3 = $html->find('#forty-eight-hour');

print_r ($ret3);

$ret4 = $html->find('#current-depth');

print_r ($ret4);

$ret5 = $html->find('#year-to-date');

print_r ($ret5);

?>

这里是输出

[email protected] /var/www $php test4.php

Array

(

)

Array

(

)

Array

(

)

Array

(

)

Array

(

)

2015-11-10

knilssen

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值