我在使用代理时遇到一些问题,PHP Simple HTML DOM Parser。我阅读了他们对手册中程序的信息,但它仍然不合作。在PHP中使用代理简单的HTML DOM解析器
require_once('simple_html_dom.php');
$url = 'http://www.whatsmyip.org/';
$proxy = '00.000.000.80:80';
$context = array(
'http' => array(
'proxy' => $proxy,
'request_fulluri' => true,
),
);
$context = stream_context_create($context);
$dom = new simple_html_dom();
$dom = file_get_html($url, false, $context);
echo '<pre>';
print_r($dom);
echo '</pre>';
啊是的。 “不工作”。非常具体。你有没有尝试通用电脑治愈#1:重新启动/重新启动? –
你确实拥有'00.000.000.80:80'的代理服务器吗?因为这不是一个有效的IP。 –
@MarcB对不起Mark,看起来会在一分钟后超时。 –