웹 페이지의 일부 콘텐츠를 컬 및 simple_html_DOM을 사용하여 표시하려고합니다. 콘텐츠를 표시 할 때마다 html 콘텐츠를 실제로 표시하는 방법을 배열로 나타냅니다.simple_html_DOM을 사용하여 웹 페이지에서 div를 표시합니다.
<?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;
?>
덕분에
그래도 outterext를 사용하여 표시 할 수있게되었지만 iframe 내부에서 만드는 호출은 다음과 같습니다. 내 URL을 사용하는 대신 사이트에서 정보를 얻으려고 내가 얻을 수있는 모든 것입니다 페이지는 서버 메시지에서 찾을 수 없습니다 – arrowill12
내가 예를 들어 변수를 에코하기 전에 속성을 변경하는 방법은 iframe에 src 변경? – arrowill12
수정 된 게시물 확인 –