// Create DOM from URL or file $html = file_get_html('http://www.google.com/'); // Find all images foreach($html->find('img') as $element) echo $element->src . '<br>'; // Find all links foreach($html->find('a') as $element) echo $element->href . '<br>';
Nicolas Chabanovsky♦
38.1k5454 gold marks222222 silver marks438438 bronze marks
KaZatsKaZats
3.26288 silver marks1818 bronze marks
+1: HTML parsing must be trusted by the parser. - VladD
simple html dom doesn't suit me ... - kotdg
foreach ($ html-> find ('div') as $ element) print_r ($ element);Warning: mb_strpos (): Offset not in string / ... / simple / simple_html_dom.php on line 1570 - kotdg
How to pull the contents of the tag through preg_match_all?
How to remove the contents of the tag
<p> </p>
?It doesn’t fit because there are a lot of
<p>
tags on starnitsa, it’s necessary that you only take from the block1 answer
PHP Simple HTML DOM Parser . How to get HTML elements?
Source: https://ru.stackoverflow.com/questions/171753/
More articles:
All Articles