PHP DOM Cannot print each <td> elements from table`s column in an array

I am scraping some table content elements from this web page:

Here is a screenshot of the table: VEHICLE FITMENT from which I want to get content:

enter image description here

I want to print each column data- for example those in ,Brand and model", ,Type", etc. in a new array so then I can put them in a csv file. Here is my code so far:

            $description = $html->find("iframe[id=desc_ifr]", 0);
            if($description != null){
                $source = $description->src;

                    $descrHtml = getWebPage($source);
                    $descrDom = new simple_html_dom();

                    foreach ($descrDom->find(".tbl-fit") as $key => $td) { 
                    $descr=$td->plaintext ."\n";

I’m probably remembering it wrong but I seem to remember PHPs dom objects to be so overflowing with data that someone made the decision to make it impossible to print_r or var_dump them.

I always wound up having to use some other library for this kind of task like symfony dom crawler or querypath

It is right however my task is to use the DOM library

Sponsor our Newsletter | Privacy Policy | Terms of Service