我試圖通過PHP
獲得第一個圖像中的頁面與類Foo
<?php
$document = new DOMDocument();
@$document->loadHTML(file_get_contents('http://www.cbsnews.com/8301-501465_162-57471379-501465/first-picture-on-the-internet-turns-20/'));
$lst = $document->getElementsByTagName('img');
for ($i=0; $i<$lst->length; $i++) {
$image = $lst->item($i);
echo $image->attributes->getNamedItem('src')->value, '<br />';
}
?>
獲得與特定網頁類的第一個圖像的代碼獲得從頁面的所有圖像,我是現在試圖從this page
一些細節?也許甚至有些代碼?我們不是通靈 – George
使用dom解析器 –
@ F4r-20我試圖從頁面這樣的頁面獲得第一個頭像http://forums.digitalpoint.com/showthread.php?t=1399697我想要得到此圖片http://forums.digitalpoint.com/image.php?u=246759&dateline=1256890274 –