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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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