Pogledajte određenu poruku
Staro 17. 04. 2012.   #16
webarto
expert
Grand Master
 
Avatar webarto
 
Datum učlanjenja: 11.04.2010
Poruke: 998
Hvala: 141
959 "Hvala" u 153 poruka
webarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished road
Default

@ivanhoe, mislim da preg_match nije dobro, jer je overkill da se nešto uradi, ili promjeni... možeš sve uraditi sa CSS selektorima (barem ja što sam radio scrapinga)...

Zend Query (nisam testirao)
PHP kôd:
    $dom = new Zend_Dom_Query($html);
    
$results $dom->query('a[href*="cenovnik"]');

    foreach (
$results as $result)
        echo 
$result->href

Simple HTML DOM

PHP kôd:
$e $html->find('a[href*="cenovnik"]'0);
echo 
$e->href;

$e $html->find('a[text^="Prices"]'0);
echo 
$e->href$e->innertext
[attribute] Matches elements that have the specified attribute.
[attribute=value] Matches elements that have the specified attribute with a certain value.
[attribute!=value] Matches elements that don't have the specified attribute with a certain value.
[attribute^=value] Matches elements that have the specified attribute and it starts with a certain value.
[attribute$=value] Matches elements that have the specified attribute and it ends with a certain value.
[attribute*=value] Matches elements that have the specified attribute and it contains a certain value.
__________________
Github // LinkedIn // PHP // ZCE // Stackoverflow PHP // Site5 Web Hosting
webarto je offline   Odgovorite uz citat