Skip to content
Advertisement

Getting a nested element PHP HTML Simple Dom

I want the commented items from an external website. I cannot edit the website.

The website looks like this, i editted a lot of things out but this is the path from the body:

JavaScript

I am using PHP HTML Simple Dom and PHP 7.3.

I am currently using this code to get the information from the website:

JavaScript

I get an error in the script, not on the website but in the logs of my apache2 server. See below:

JavaScript

Do you want more information, just comment.

Advertisement

Answer

If I understand you correctly, something along these lines should get you close enough to what you are looking for:

JavaScript

Output:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement