【发布时间】:2013-09-11 02:59:17
【问题描述】:
<?php
// Report all PHP errors (see changelog)
error_reporting(E_ALL);
include('inc/simple_html_dom.php');
//base url
$base = 'https://play.google.com/store/apps';
//home page HTML
$html_base = file_get_html( $base );
//get all category links
foreach($html_base->find('a') as $element) {
echo "<pre>";
print_r( $element->href );
echo "</pre>";
}
$html_base->clear();
unset($html_base);
?>
我有上面的代码,我正在尝试获取 Play 商店页面的某些元素,但它没有返回任何内容。是否有可能在服务器上禁用某些 PHP 功能来阻止它?
以上代码在其他网站上也能完美运行。
有什么解决办法吗?
【问题讨论】:
-
对我来说工作得很好......
标签: php html-parsing file-get-contents simple-html-dom