slpctrl Posted November 10, 2008 Share Posted November 10, 2008 Hello all, here's what I want to do: http://www.futuresboard.com/ The side panel with the stock info and: http://www.futuresboard.com/?ab=quotescharts That whole table. I want to use CURL in PHP to grab this information, and I really don't know how to grab a whole table, I really only know how to grab a single word. Can anyone help me to grab that information with regex and CURL? Any help would be GREATLY appreciated Quote Link to comment Share on other sites More sharing options...
slpctrl Posted November 10, 2008 Author Share Posted November 10, 2008 Btw: <?php $url = "http://www.futuresboard.com/index.php"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6"); $result = curl_exec($ch); curl_close($ch); echo $result; ?> That's what I'm using, so all the HTML is obviosuly stored in the $result variable. I just can't extract that information from it . Quote Link to comment Share on other sites More sharing options...
ddrudik Posted November 12, 2008 Share Posted November 12, 2008 You just want the table? the table's not on that page, it appears to instead be at: http://sites3.barchart.com/pl/futuresboard/default.htx?ab=quotescharts After you curl that page, this regex pattern should remove most of the js code: <?php $sourcestring="your source string"; echo preg_replace('#^document\.write\(\'(?:<font color="\' \+ bcfn_GetColor.*)?|\\n.*$#m','',$sourcestring); ?> It's almost like they would you rather not scrape their site... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.