1
I가 특정 링크에서 링크를 얻을 다음 코드를간단한 PHP DOM 파서 - 찾을 요소
if($site === 'Test') {
$list = $html->find('div.most-viewed-section ol li');
foreach($list as $item) {
$link = $item->find('a', 0)->href;
$headline = $item->find('a', 0)->innertext;
$image = $item->find('span.image-optional a img', 0);
if($image) {
$image = $image->src;
}
$Post[] = array('link' => $link, 'headline' => $headline, 'image' => $image);
}
}
하지만 지금은 또한 다음과 같은 링크 요소 찾기 수행 할 작업 :
$link = $item->find('a', 0)->href;
을
아무에게도이를 달성하는 방법에 대한 제안이 있습니까? 감사
이