Jump to content

Extracting data from a table of another site


juz4eugene

Recommended Posts

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];

?>

 

Anyone has a script that I could modify to do that? Thanks!

Link to comment
Share on other sites

You've done...nothing here.  What do you know about regex?  You should be able to do this with relatively simple regular expressions.  There aren't really any pre-made scripts for screen scraping.

 

Also, it's probably illegal to scrape the Journal.

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.