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
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
I have scripted something like this but I used XPATH functions or XML DOM stuff. Check out the following tutorial and see if you can apply it to your situation. http://www.merchantos.com/makebeta/php/scraping-links-with-php/