jonghwanhyeon / overwatch-stats

A Python library to query a player's overwatch stats from Battle.net
MIT License
12 stars 2 forks source link

NoneType object has no atribute 'group' #8

Closed 0x3444ac53 closed 6 years ago

0x3444ac53 commented 6 years ago

`>>> stats = overwatch.stats.query('xbl', 'Slvrsun') Traceback (most recent call last): File "", line 1, in File "/home/ellie/.local/lib/python3.7/site-packages/overwatch/stats/init.py", line 28, in query output['level'] = extract_level(tree) File "/home/ellie/.local/lib/python3.7/site-packages/overwatch/stats/extractors.py", line 38, in extract_level base_level = LEVEL_IDS[match.group(1)] AttributeError: 'NoneType' object has no attribute 'group'

`

jonghwanhyeon commented 6 years ago

This issue is related with #6 and (partially) fixed. Please update the library 😄

Matf661 commented 3 years ago

Hi jonghwanhyeon, thank you for making this, however I am also having this 'NoneType' object has no attribute 'group' issue.

"

in 1 import overwatch.stats ----> 2 stats = overwatch.stats.query('pc', '현종환#3104') ~\anaconda3\lib\site-packages\overwatch\stats\__init__.py in query(platform, battle_tag) 26 27 output = {} ---> 28 output['level'] = extract_level(tree) 29 output['endorsement'] = extract_endorsement(tree) 30 output['icon_url'] = extract_icon_url(tree) ~\anaconda3\lib\site-packages\overwatch\stats\extractors.py in extract_level(tree) 36 37 match = re.search(r'/playerlevelrewards/(0x[0-9A-Z]+)_Border', level.get('style')) ---> 38 base_level = LEVEL_IDS[match.group(1)] 39 40 return base_level + int(level.text_content().strip()) AttributeError: 'NoneType' object has no attribute 'group' "