B
B
Bur Ov2018-02-17 23:30:48
PHP
Bur Ov, 2018-02-17 23:30:48

How to parse a DIV with a specific class using simple html dom?

Good afternoon. How to parse a DIV with a specific class using simple html dom? I try so: Issues all loaded page.

include 'simple_html_dom.php';

$html = new simple_html_dom();

$url = file_get_html('https://4pda.ru/forum/index.php?showuser=5083350');
$html->load($url);


$ret = $html->find('.statistic-box');
var_dump($ret);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2018-02-18
@xmoonlight

Option 1:

$ret = $html->find('.statistic-box');
echo $ret[0]->plaintext;

Option 2:
$ret = $html->find('*[class=statistic-box]');
echo $ret[0]->plaintext;

https://github.com/PeratX/SimpleHtmlDom/wiki/PHP-S...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question