駅データ.jpさんのxmlからparseします。
from bs4 import BeautifulSoup
import urllib.request as req
url = "http://www.ekidata.jp/api/s/1130224.xml"
res = req.urlopen(url)
soup = BeautifulSoup(res, 'html.parser')
code = soup.find("line_cd").string
line = soup.find("line_name").string
station = soup.find("station_name").string
print(code, line, station)
[vagrant@localhost python]$ python3 app.py
11302 JR山手線 東京
しかし、これ、どうやって駅のデータ収集しているんだろうか。
http://www.ekidata.jp/agreement.php
駅探など、乗り換えのサービスは素晴らしいよね。