poe-api
poe-api copied to clipboard
AttributeError: 'NoneType' object has no attribute 'group'
Got an error, I don't know why. I have already checked multiple issues on this github but why won't it work?
Traceback (most recent call last): File "C:/Users/ManM15/OneDrive - Berkhamsted Schools Group/Documents/Code/Poe.py", line 3, in <module> client = poe.Client("FQvugE1iK7jI0BKGrReYBQ%3D%3D") File "C:\Users\ManM15\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\poe.py", line 123, in __init__ self.connect_ws() File "C:\Users\ManM15\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\poe.py", line 365, in connect_ws self.setup_connection() File "C:\Users\ManM15\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\poe.py", line 149, in setup_connection self.next_data = self.get_next_data(overwrite_vars=True) File "C:\Users\ManM15\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\poe.py", line 193, in get_next_data json_text = re.search(json_regex, r.text).group(1) AttributeError: 'NoneType' object has no attribute 'group'
hit the same error, because the content of the page returned by requesting poe.com is garbled, leading to no regular matching :
r = request_with_retries(self.session.get, self.home_url)
json_regex = r'<script id="__NEXT_DATA__" type="application\/json">(.+?)</script>'
json_text = re.search(json_regex, r.text).group(1)
r.content: b'\x1f\xef\xbf\xbd\x08\x00\x00\x00\....'
The reason why the content is grbled may be the response content is compressed by gzip, you need to decompress it first.
'Content-Encoding': 'gzip'
got the same error, is there any help?
same here from yday. even tried different account and token. still same error!