그래서 PHP 크롤러 (개인용)를 만들려고합니다. 코드에서 1 시간 이내에 종료되지만 문제가있는 것으로 예상되는 각 eBay 경매 항목에 대해 "found"가 표시됩니다. 크롤러는 모든 span 요소를 가져올 수 없으며 "remaining time"요소는 다음과 같습니다.PHP 크롤러는 모든 요소를 크롤링하지 않습니다.
simple_html_dom.php가 다운로드되고 편집되지 않습니다.
<?php include_once('simple_html_dom.php');
//url which i want to crawl -contains GET DATA-
$url = 'http://www.ebay.de/sch/Apple-Notebooks/111422/i.html?LH_Auction=1&Produktfamilie=MacBook%7CMacBook%2520Air%7CMacBook%2520Pro%7C%21&LH_ItemCondition=1000%7C1500%7C2500%7C3000&_dcat=111422&rt=nc&_mPrRngCbx=1&_udlo&_udhi=20';
$html = new simple_html_dom();
$html->load_file($url);
foreach($html->find('span') as $part){
echo $part;
//when i echo $part it does display many span elements but not the remaining time ones
$cur_class = $part->class;
//the class attribute of an auction item that ends in less than an hour is equal with "MINUTES timeMs alert60Red"
if($cur_class == 'MINUTES timeMs alert60Red'){
echo 'found';
}
}
?>
모든 대답은,이 클래스 alert60Red
는 자바 스크립트를 통해 설정되어있는 경우로 보인다 가져온 HTML을 보면 미리
echo $ html; 정상적으로 모든 요소를 표시하고, 무언가 이해가되지 않는다면 유감스럽게 생각합니다. 제 질문은 여기에 있습니다. –