从basketball-reference.com中收集nba球员数据,并且很少有方法对数据进行排序

StatsScraper的Python项目详细描述


一个简单的cli python web scraper,可以刮除nba 来自basketball-reference.org和 允许球员按分数、篮板和 协助和展示。

安装

使用pip安装statsscraper2.0.0

pip install StatsScraper2.0.0

用法

代码摘录自py

from StatsScraper import Scraper

scraper = Scraper()

result = scraper.find_player_by_name("Ivica Zubac")
print("Printing result\n")
for p in result:
    print(p)

sorted_points = scraper.sort_by_points("SG")
print("========Printing top scorers========\n")
for scores in sorted_points:
    print(scores[0], scores[1])

sorted_assists = scraper.sort_by_assists("PF")
print("\n\n\n=========Printing top 10 assisters========\n")
count = 0
for assists in sorted_assists:
    if(count >= 10):
        break
    print(assists[0], assists[1])
    count += 1

sorted_rebounds = scraper.sort_by_rebounds("PG", "SG")
print("\n\n\n=========Printing top 20 rebounders========\n")
count = 0
for rebounds in sorted_rebounds:
    if(count >= 20):
        break
    print(rebounds[0], rebounds[1])
    count += 1

确认

感谢奥斯卡·桑切斯的文章“网上搜刮NBA数据” 对于部分刮码

许可证

MIT

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java log4j找不到log4jtest。房产?   我在java线程“awteventque1”中获得异常。lang.NullPointerException   java为什么在使用完整路径从文件系统读取文件时出错?   java如何迭代所有注册表项?   java中的安卓 Opencv SVM未正确训练   多线程Java ThreadPoolExecutor关闭特定线程?   如何使用Java NIO CreateDirectory方法设置目录所有者组?   java NatTable混合了固定宽度的列和可调整大小的填充剩余空间   java如何删除特定网络,即使该网络是由安卓上的其他设备创建的?   java Guava toJavaUtil()不存在   java对许多常量使用枚举是有效的memorywise?   java是否可以使用坐标定位JButton?   从WSDL生成java代码导致异常   java如何在安卓中导出javadoc   爬行JAX中的java NoClassDefFoundError错误   java为片段中的文本视图设置区域设置   发送最后一条消息后发生Java RMI RemoteException