PDA

View Full Version : Simple Data Scraping from Table?



kaje
24 Feb 2009, 08:30 PM
I need a method for scraping some statistical data out of tables on a website and place it onto another website that I wish to optimize for the iPhone. This information gets updated frequently, so it can't be a one time thing, but something that gets pulled everytime the iPhone optimized page is opened. I don't have access to the data source, so I won't be able to get the information from there. Does anyone have any ideas for how to go about that?

I have nearly no experience with HTML scripting so I'd love to know what would be the easier way to do this. I have played around a little bit with Google Spreadsheet which has a simple ImportHTML() function so I imagine there should be a fairly easy option out there for doing it onto a website.

The ImportHTML() function/formula went something like:

=ImportHTML("http://url", "table", 8)

8 being the 8th table in the page that it pulls the data from. Then it filled the spreadsheet with all of the data how it's displayed in the table.

Here is an example of a site I would like to pull data off:

http://tinyurl.com/cbvenh

hpwebsolutions
08 Mar 2009, 09:21 PM
That seems like a fun project. I did a google search using the phrase "PHP parse HTML table" and I got the following link that looks like it should do the trick: http://tobyinkster.co.uk/blog/2007/07/20/html-table-parsing/

It also turned up the following link, scroll to the section titled "The Old Table Extractor": http://jacksleight.com/blog/2008/01/14/really-shiny/scripts/table-extractor.txt


Let me know how it works out for you.