나는 이베이 제휴사 (파트너 네트워크) rss의 제목을 추출하는 데 PHP 코드를 사용하고 있지만 성공하지 못했습니다. 내가 도대체 뭘 잘못하고있는 겁니까? 그건 그렇고, 너무 제목을 연결할 수 있습니까?RSS 피드 항목 제목을 추출 할 수 없습니다.
<?php
$xml = new DOMDocument();
@$xml->loadHTMLFile('http://rest.ebay.com/epn/v1/find/item.rss?keyword=%28jewelry%2Ccraft%2Cclothing%2Cshoes%2Cdiy%29&sortOrder=BestMatch&programid=1&campaignid=5337945426&toolid=10039&listingType1=All&lgeo=1&topRatedSeller=true&hideDuplicateItems=true&entriesPerPage=2&feedType=rss');
$products = array();
//Loop through each <td> tag in the dom and extract inner html
foreach($xml->getElementsByTagName('td') as $p) {
$children = $p->childNodes;
$phtml = '';
foreach ($children as $child)
{
$phtml.= $p->ownerDocument->saveHTML($child);
}
echo '<div id="mainproductafilioright1"><div class="product">' . $phtml . '</div></div>';
}
?>
어 -' getElementsByTagName ('td')'RSS 피드를 얻는 것을 보면'td' 태그가 없습니다 ... 코드를 복사하고 원하는 것을하기 위해 코드를 전혀 편집하지 않았습니다. – cmorrissey
그것이 다른 RSS 용으로 이전에 구성 해 놓은 코드이기 때문입니다. – User325313