All Projects → gojuukaze → BeiJingSubwayFlows

gojuukaze / BeiJingSubwayFlows

Licence: Apache-2.0 license
北京地铁客流量统计(py爬虫+js统计图)

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to BeiJingSubwayFlows

BJSubwayPen
北京地铁路线图绘制工具
Stars: ✭ 41 (+127.78%)
Mutual labels:  subway, beijing, beijingsubway
2ndhand house
北京二手房价数据分析
Stars: ✭ 47 (+161.11%)
Mutual labels:  beijing
Kafka-meetup-3rd
No description or website provided.
Stars: ✭ 13 (-27.78%)
Mutual labels:  beijing
citylines
Citylines.co is a collaborative platform for mapping the transit systems of the world!
Stars: ✭ 53 (+194.44%)
Mutual labels:  subway
goodservice
Website that detects headway discrepancy on New York City Subway system using live countdown clocks
Stars: ✭ 26 (+44.44%)
Mutual labels:  subway
bj-mobile-iptv
北京移动IPTV播放列表 Beijing Mobile IPTV playlist bj-mobile-iptv.m3u
Stars: ✭ 96 (+433.33%)
Mutual labels:  beijing
the-subway-of-china
中国地铁图
Stars: ✭ 104 (+477.78%)
Mutual labels:  subway
theweekendest
Real-time New York City subway service map
Stars: ✭ 51 (+183.33%)
Mutual labels:  subway
Next-Station-iOS
Source code of Next Station iOS app, available on App Store for downloading.
Stars: ✭ 15 (-16.67%)
Mutual labels:  subway
path-data
A gRPC API that exposes various information about the PATH transit system.
Stars: ✭ 29 (+61.11%)
Mutual labels:  subway
railrouter-sg
A progressive web app that lets you explore MRT and LRT rail routes in Singapore
Stars: ✭ 29 (+61.11%)
Mutual labels:  subway
metro-map-maker
Build the Metro system of your dreams: create your own metro maps, save them, and share with friends!
Stars: ✭ 41 (+127.78%)
Mutual labels:  subway
sp-subway-scraper
🚆This web scraper builds a dataset for São Paulo subway operation status
Stars: ✭ 24 (+33.33%)
Mutual labels:  subway
subway-time
A nice NYC Subway time table.
Stars: ✭ 25 (+38.89%)
Mutual labels:  subway
subwayclock
Display clock for NYC subways
Stars: ✭ 29 (+61.11%)
Mutual labels:  subway

BeiJingSubwayFlows

这个爬虫代码已过时,不再维护
之前微博是把html代码放到了js中,所以可以从代码中直接提取需要的数据

突然很好奇北京地铁每天的客流量变化,于是写了个爬虫。结果很有意思,每周7天的客流变化都很规律


结果:

https://www.ikaze.cn/sub_flows.html

其他:

  • 使用python3爬数据,echart统计图  
  • 爬虫的结果直接存到了文件中,因为项目比较小,就不用数据库了  
  • 爬虫脚本只是爬昨天的数据的,需要所有的要改一下get_flow_from_html()函数
def get_flow_from_html(html):

    # 需要根据页数调整年份
    year = 2018

    soup = bs(html, 'html.parser')
    work_list = soup.find_all('div', class_='work_list')
    data = work_list[0].find_all('li')
    for d in data:
        s = data.get_text()
        ...

然后直接循环跑就行:

page=200
while page>0:
    html = get_html(get_page_url(page))
    get_flow_from_html(html)
    ...
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].