PHP Screen Scrape

Discussion in 'PHP' started by mrbrantley, Mar 20, 2008.

  1. #1
    Hey all! Working on a scraper project using PHP5 and need some help phrasing the data. I have gotten it narrowed down pretty well, I just do not understand how to 'extract' certain rows / cells in a table.

    I already have the main table data that I need extracted from the target url.
    I need to extract the 2nd TR / TD from the 2nd table.
    I need to extract the 2nd TR / 1st TD AND the 2nd TR / 2nd TD from the 4th Table.

    I'm not looking for someone to write it for me, just a direction to go in. I think Preg_match_all is the best solution, but I am not sure. Im stumped!

    Thanks!

    EDIT: Check this out. ~20 minutes after posting and trying a different Google search for more results, I find my post at # 4 & 5 on the SERP's. Interesting. Google Results
     
    mrbrantley, Mar 20, 2008 IP
  2. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #2
    You can preg_match_all the table, then preg the rows of each table you want.

    Alternatively, does the data happen to be XML? If so, try http://uk.php.net/dom
     
    jayshah, Mar 20, 2008 IP
  3. RoscoeT

    RoscoeT Peon

    Messages:
    78
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    RoscoeT, Mar 20, 2008 IP