Jump to content

Need some help getting some info


slpctrl

Recommended Posts

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  :D

Link to comment
https://forums.phpfreaks.com/topic/132210-need-some-help-getting-some-info/
Share on other sites

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 :(.

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...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.