Where's the source of this webpage?
I am just starting out to learning Python and have taken some online courses in my free time.
I am trying to find the data source for this website, making a daily count of departures from the airport, and eventually building a flights vs date plot.
Have spent two weeks investigating the page source, but am unable to find the json source. Would a kind soul please show me where the json source is? Thanks!
https://www.changiairport.com/cag-web/flights/departures?lang=en&callback=JSON_CALLBACK&date=today
There you go. That will give you the flight schedule for today. The date parameter can probably be other things too, but I don’t know what the options are. Any normal get request should work, it seems publicly accessible.
You just need to right click and go to "inspect" then hit the "network" tab and then just browse through the different requests.
Just a note:
Just for the record, this is called scraping and it’s often in a legal gray area where, so long as you aren’t using it too extensively or making a profit off of it you probably won’t get in any trouble, but just make sure you have permission from the company if you plan to make a lot of calls to an open API like this. It’s usually against their terms of service, but as an unenforced clause that they will only use if you become a nuisance.