Npr. na brzinu preuzimenje linkova:
Kôd:
$dom = new DOMDocument();
@$dom->loadHTMLFile('http://www.kupime.com/aktivne-ponude/');
$xpath = new DOMXPath($dom);
$entries = $xpath->query("//ul[@id='list_offers']//table//a/@href");
foreach($entries as $e) {
echo 'http://www.kupime.com' . $e->textContent . '<br />';
}
Preuzimanje određenog sadržaja sa neke od stranica:
Kôd:
$dom = new DOMDocument();
@$dom->loadHTMLFile('http://www.kupime.com/ponuda/4299-din-umesto-10000-din-za-brazilsko-fenirane-kose-u-salonu-beauty-studio-hot/366');
$xpath = new DOMXPath($dom);
echo $xpath->query("//h1[@id='offer_title']")->item(0)->textContent;
echo '<hr />';
echo $xpath->query("//div[@id='description']")->item(0)->textContent;
echo '<hr />';
echo $xpath->query("//div[@id='img_border']/img/@src")->item(0)->textContent;
Zgodan alat za ovako nešto:
https://addons.mozilla.org/en-us/fir...ddon/firepath/
Pozdrav.