BeiJingSubwayFlows 结果:其他: 北京地铁客流量统计工具

程序名称:BeiJingSubwayFlows 结果:其他:

授权协议: Apache

操作系统: 跨平台

开发语言: Python

BeiJingSubwayFlows 结果:其他: 介绍

北京地铁客流量统计(py爬虫+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)
    ...

BeiJingSubwayFlows 结果:其他: 官网

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

相关编程语言

Pacman 是一个软件包管理器, 作为 ArchLinux 发行版...
Smb4K 是KDE下的网络共享浏览器 更多屏幕截图请看:...
Wine (“Wine Is Not an Emulator” 的首字母缩写)...
虚拟桌面软件,可管理最多9个虚拟桌面,你可以用热键...
UNetbootin (Universal Netboot Installer)为一种跨...
Cobbler 可以用来快速建立 Linux 网络安装环境,它已...