simple_html_dom适用于特定的URL 'https://www.redbus.in/info/OfferTerms ',不适用于' https://www.abhibus.com/bus-ticket-offers '。我不知道为什么吗?
这有效
<?php
include('./simplehtmldom_1_9_1/simple_html_dom.php');
$html = file_get_html('https://www.redbus.in/info/OfferTerms');
echo $html;
?>
这不起作用
<?php
include('./simplehtmldom_1_9_1/simple_html_dom.php');
$html = file_get_html('https://www.abhibus.com/bus-ticket-offers');
echo $html;
?>
我获取Abhibus网址时出错:
警告:file_get_contents(https://www.abhibus.com/bus-ticket-offers):打开流失败:HTTP请求失败!第82行上的C:\ wamp \ www *** \ simplehtmldom_1_9_1 \ simple_html_dom.php中的HTTP / 1.0 403