-3

Possible Duplicate:
HTML Scraping in Php

Far from being web developer expert, so sorry in advance if I'm missing something basic:

I need to copy a table into mySql database using PHP; the table resides in a website which I don't own, however I have permission to copy and publish.

Manually when I watch this website in my web-browser I need to click on a link in the main website URL (I can't reach the final destination page link since it changes all time, however the main page link is static and the link to click is also static).

Example to such a content I need to copy from (just an example, this is not the real content): http://www.flightstats.com/go/FlightStatus/flightStatusByAirport.do?airportCode=JFK&airportQueryType=0

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Yizhar
  • 875
  • 9
  • 11
  • 2
    and standard question - what have you tried? – Alexander Larikov Sep 22 '12 at 16:42
  • Only because you need something, this is not yet a question. What is your concrete question? At which part is your first problem you run over and what do you would like to know? Or do you want to learn how to build a scraper? – hakre Sep 22 '12 at 16:57
  • Thanks for the comment. I've tried looking at Selenium, and some Wordpress plugin for web scraping, and then widtheld myself and asked general question purposely - since it can't be that compilcated nowadays to perform such trivial task, I believe it's just me cannot FIND an existing solution (which don't need to be re-invented). Here is where I asked for your help, to recommend appropriate platform for such a task. Thanks in advance... – Yizhar Sep 22 '12 at 20:31

1 Answers1

-1

Most people are going to ask what have you tried. Since you mentioned that you don't have much development experience, here are some tips on how to go about it - have to put it as an answer so it is easier to read.

What you're going to need to do is scraping.

Using PHP, you'd use the following functions at the very least

file_get_contents() - this function will read the data in the URL

preg_match_all - use of regular expressions will let you get the data you are looking for. Though some/many people will say that you should go through the DOM.

The data that is returned with preg_match_all can be stored into your MySQL table. Though because the data changes so frequently, you might be better off just scraping that section and storing the entire table as cache (though I do have to say I have no idea what you are trying to do on your site - so I could well be wrong).

Duniyadnd
  • 4,013
  • 1
  • 22
  • 29