我想显示一些内容从网页使用卷曲和simple_html_DOM每当我回声内容它只是一个数组如何让它实际显示HTML内容?从网页显示div与simple_html_DOM
<?php
echo ("hello");
include 'simple_html_dom.php';
$curl = curl_init();
curl_setopt ($curl, CURLOPT_URL, "http://catalog.hastingsfilter.com/startautoapps.html");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)");
curl_setopt($curl, CURLOPT_AUTOREFERER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_REFERER, "http://catalog.hastingsfilter.com/startautoapps.html");
$result = curl_exec ($curl);
curl_close ($curl);
//write contents of $result to file
$File = "page.txt";
$fh = fopen($File, 'w') or die("can't open file");
fwrite($fh, $result);
fclose($fh);
//turn file into dom object
$page = file_get_html("page.txt");
$div = $page->find('div[id=columnright]');
echo $div;
?>
感谢
好吧我得到它使用outertext显示...但它在iframe内部调用是使用我的网址,而不是我即时获取信息的网站所以我得到的是页面无法在服务器消息中找到 – arrowill12
有没有办法在我回显变量之前更改属性,例如更改iframe上的src? – arrowill12
检查编辑后 – 2012-06-07 01:30:11