Skip to content
Advertisement

simple-html-dom get table id by class name

I’am trying to build a scraper using simple-html-dom.

Each tr has the class “event-listing” as well as a unique id. Everything is working but I cannot figure out how to get and store the id’s.

Here’s my code:

JavaScript

Advertisement

Answer

You don’t need anything special $event->id would work just fine

JavaScript

Output

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