0

I am looking for advise. The following website

http://brfares.com/#home

provides fares information for UK train lines. I would like to use it to build a database of travel costs for seasons tickets from different locations. I have never done this kind of thing before but have experience with Python/Bash scripting and some HTML.

Viewing the source code for a typical query the actual fair information is not displayed in index.html. Can anyone provide a pointer as to how to go about scraping (a new word for me) the information.

4

1 に答える 1

1

クエリの URL は次のとおりです。http://brfares.com/querysimple?orig=SUY&dest=0415&rlc=

応答は json オブジェクトです。

まず、すべての宛先コードのルックアップ テーブルを作成する必要があります。次のリンクを使用してそれを行うことができますhttp://brfares.com/ac_loc?term=。アルファベットのすべての文字に対してそれを行い、一意のリストを解析します。

次に、それらをペアで取得し、json クエリを実行し、返された json を解析して、データをデータベースにフィードします。

これで、そのデータベースでやりたいことが何でもできます。

于 2013-06-28T21:32:24.347 に答える