I refer to the find function in the foreach condition — it works; In the iteration I am writing in order to look in depth in what has already been found - it gives an error that it does not find such a method. I entered the library itself and wrote public there near the find function, it does not help. What to change or add?

<?php include_once("simple_html_dom.php"); $html=new simple_html_dom(); $html->load_file(www.example.com); foreach ($html->find('div.article') as $article){ echo $article->find('img',0)->src; } 
  • one
    and instead of www.example.com what is actually written? and written as a string or without quotes? - Alexey Shimansky
  • If you read the manual more carefully simplehtmldom.sourceforge.net/manual.htm#section_find you can see that the descendants should be searched for not using the find - u_mulder method
  • @u_mulder, just the same, if you carefully read the manual, you can find examples of finding children through the find() method. For example, in the Scraping Slashdot! Quick Start section on your own link. - neluzhin
  • I rewrote the code in the same way, the error is also displayed, but the loop works and searches for find. Thanks to all. - Andrey

0