0

I'm trying to write some code that will check a certain webpage for a metric. Does anyone know of any good tutorials or examples which call on a certain page, and checks for a metric? I would be looking through a table for the current date and checking the impressions metric (see code) This is just the first row but, but I would need to find the current date in the table and find the next "td-impr" class and check what the metric is. I already know how to get the current date in that format, just don't know how to call a page and get to this specific part of the table.

<div id="contentBody" class="flexcroll" style="height: 200px; overflow: hidden;">
<table class="prod">
<tr>
    <td class="td-date">05/06/13</td>
    <td class="td-impr">0</td>
    <td class="td-clicks">0</td>
    <td class="td-ctr">0%</td>
</tr>
Ninjakannon
  • 3,751
  • 7
  • 53
  • 76
Joel Levy
  • 55
  • 1
  • 7

1 Answers1

0

There are web site parsing libraries out there. I used JSoup (at http://jsoup.org/) for Java to parse the IBM information center and was successful. There are examples for table parsing everywhere, like at how to parse a table from HTML using jsoup.

Since the question is about parsing HTML in PHP: I personally never used such a PHP library. However How do you parse and process HTML/XML in PHP? may help.

Community
  • 1
  • 1
Tony Stark
  • 2,318
  • 1
  • 22
  • 41