K
K
Kirill Gorelov2016-05-29 16:08:10
PHP
Kirill Gorelov, 2016-05-29 16:08:10

Parsing through simple_html_dom.php search in div?

Hello.
I decided to study the simple_html_dom library.
And I came across this problem.
I can't take a link from a certain diva.

include 'simple_html_dom.php';
$html  = file_get_html('ссылка на страницу');
foreach ($html->find('div.wall_post_text a') as $e) {
  echo $e->outertext; 
}

Tried another option. But it doesn't return anything either.
foreach($html->find('div.wall_post_text') as $element) {
   echo $element->href . '<br>';
}

What does this div block look like.
<div class="wall_post_text">Чем лучше воспользоваться - таргетом или контекстом? Куда вести посетителя - на лендинг или в группу ВК? Что может помешать конвертации лидов в продажи? Лучше получить ответы на эти вопросы до запуска рекламной кампании!<br><br>Читать далее: <a href="https://site.ru/dom.php" title="https://site.ru/dom.php">ссылка</a></div>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Max, 2016-05-29
@matios

Or maybe it is loaded by Ajax and it is not in the original DOM?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question