def main():
driver.get("https://www.dotabuff.com/heroes/winning?date=patch_7.04")
rows = driver.find_elements_by_xpath("//table/tbody/tr")
old_winrates = {}
for row in rows:
cells = row.find_elements_by_xpath("td")
hero = cells[1].text
winrate = float(cells[2].get_attribute("data-value"))
old_winrates[hero] = winrate
driver.get("https://www.dotabuff.com/heroes/winning?date=patch_7.05")
rows = driver.find_elements_by_xpath("//table/tbody/tr")
win_rate_diff = {}
for row in rows:
cells = row.find_elements_by_xpath("td")
hero = cells[1].text
winrate = float(cells[2].get_attribute("data-value"))
win_rate_diff[hero] = winrate - old_winrates[hero]
with open(os.environ.get('FDOTA') + '/fantasydota/junk/windiff_705', 'w') as f:
json.dump(win_rate_diff, f)
7.05_winrate_change.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录