how to parse source code of a webpage
View Single Post
11-06-2008, 04:24 PM
Join Date: Jan 2008
so do you have to traverse through all of the information in the code to get to the spot you want to scrape?
ie... Can I start anywhere with preg_match? What if the <tr> does not have a class or id? Do I start at the top and work down to it?
// Perform an expression match
preg_match( "/<tr class=\"alternateRow\">[\s]+<td>([\w\d ,]+)<\/td>[\s]+<td>([\d\"\- ]+)<\/td>[\s]+<td>([\d\"\- ]+)<\/td>/im", $cache, $matches );
View Public Profile
Send a private message to buildakicker
Find More Posts by buildakicker