このコードでそのウェブサイトのすべてのページを検索できるかどうかを知りたかったので、すべてのページからすべての画像 src を取得します。現在、その 1 つのページから画像 src のみをプルします。while ループを使用してみましたが、メイン ページから同じ結果が何度も繰り返されるだけです。どんな助けでも素晴らしいでしょう。
<?php
include_once('simple_html_dom.php');
//show errors
ini_set('display_errors', true);
error_reporting(E_ALL);
$html = file_get_html('http://betatv.net/');
$result=($html);
while($html = ($result)) {
// find the show img and echo it out
foreach($html->find('.entry-content') as $cover_img)
foreach($cover_img->find('img') as $cover_img_link)
//echo the images src
echo $cover_img_link->src .'<br>';
echo '<br>';
}
// clean up memory
$html->clear();
unset($html);
?>
私が betatv.net を所有していることを証明するために、フロント ページにこの質問へのリンクを追加しました。