php-simple-html-dom-parser icon indicating copy to clipboard operation
php-simple-html-dom-parser copied to clipboard

How to get value from dom?

Open Adam-78 opened this issue 7 years ago • 0 comments

I have the following table - only 2 rows shown for brevity. How do I traverse the table to extract the price class value for Catalog ID 100245 i.e. H1?

 <tbody>
      <tr class="catalog_line">
         <td class="properties">
            <div class="grid-prop">
               <span class="label nom">Catalog ID</span>
               <span class="catdata1 cdatamarker">100245</span>
            </div>
            <div class="grid-prop nom">
                <span class="label">Product, price class</span>
                <span class="catdata1">
                  <span class="category">Cars</span>
                  , H1
                </span>
            </div>
        </td>
      </tr>
      <tr class="catalog_line">
         <td class="properties">
            <div class="grid-prop">
               <span class="label nom">Catalog ID</span>
               <span class="catdata1 cdatamarker">100246</span>
            </div>
            <div class="grid-prop nom">
                <span class="label">Product, price class</span>
                <span class="catdata1">
                  <span class="category">Cars</span>
                  , H1
                </span>
            </div>
        </td>
      </tr>
  <tbody>

Adam-78 avatar Jan 01 '17 15:01 Adam-78