Closed EndBug closed 5 years ago
Did you solve this?
Nope, they're still merged.
After a lot of digging, learning the basics of python and trial and error, I managed to fix it. The problem seems to come from the assumption OWAPI made that hero specific stats will always be the first DOM element to come, but apparently Blizzard changed it.
In parsing.py
, This is the new code around line 460:
for idx, sg in enumerate(stat_groups):
sg_name = stat_groups[idx].find('.//*[@class="stat-title"]').text
if sg_name == "Hero Specific":
try:
hero_specific_box = stat_groups[idx]
trs = hero_specific_box.findall(".//tbody/tr")
# Update the dict with [0]: [1]
for subval in trs:
name, value = util.sanitize_string(subval[0].text), subval[1].text
# Put averages into average_stats
if "average" in name:
into = _average_stats
elif '_avg_per_10_min' in name.lower():
name = name.lower().replace("_avg_per_10_min", "")
into = _rolling_avgs
else:
into = _t_d
nvl = util.try_extract(value)
into[name] = nvl
break
except IndexError:
pass
Now, the stats are still merged in general_stats
, however this is a simple fix to get rid of them.
It would be fantastic if you could open a PR with those changes so that the author can merge them into the repo :)
This should be fixed in Commit 5d2fb53be0f246ad7ecbc0a39eafb050209f242a. Can you vertify this and share the results in the issue?
Closed by #290 The hero-specific stats are now back in their section 👍 Thanks to everyone that worked to this issue 🎉
Issue
Just noticed that the stats that previously were in
hero_stast
are now displayed ingeneral_stats
, whilehero_stats
is just an empty object. At the moment hero-specific stats are still shown on the Overwatch website in a separate category: maybe they changed the page and the API doesn't manage to recognize them as hero-specific? Is it by design? @FuyukaiLinks that cause the issue
(Surround the links with backticks. Use triple backticks for multiple lines.)
https://owapi.net/api/v3/u/Kharumaan-2976/blob
E.g.: this is how
heroes.stats.competitive.brigitte
looks like: