Extracting data from a table of another site

I need help on extracting of data from another website, commonly known as screen scrapping. I was able to do it with a basic created function, but it doesn’t work for extracting data out from a table of another website.

I want to extract the data from each row and data of this site http://online.wsj.com/mdc/public/page/2_3021-usetf.html, so that I can put these data into my database.

My current code is

<?php
$data = file_get_contents(‘http://online.wsj.com/mdc/public/page/2_3021-usetf.html’);
$regex = ‘/You(.+?) registered/’;
preg_match($regex,$data,$match);
var_dump($match);
echo $match[1];
?>

I’d encourage you to do 3 things:

1 Get permission from the data owners to do this, or see if they have an API which permits you to grab just what you want

2 Try googling for the correct term – you are screen “scraping” not scrapping – there are plenty of tools out there to do this job.

3 Grab the file, store it locally, and then try and do your post-analysis - that is a pretty big html file