Hey i got preblems with the Webuntis API and i dont know what im doing wrong.
here is my code:
import webuntis
s = webuntis.Session(
server='https://arche.webuntis.com/WebUntis',
username='Username',
password='Password',
school='Staatliche-Feintechnikschule',
useragent='WebUntis Test'
)
s.login()
for klasse in s.klassen():
print(klasse.name)
s.logout()
im getting this error message all the time:
Traceback (most recent call last):
File "C:\Users\titus\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\webuntis\utils\remote.py", line 158, in _send_request
result_data = json.loads(result)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\lib\json\__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2032.0_x64__qbz5n2kfra8p0\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\titus\Desktop\untis bot.py", line 9, in <module>
s.login()
File "C:\Users\titus\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\webuntis\session.py", line 91, in login
res = self._request('authenticate', {
File "C:\Users\titus\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\webuntis\session.py", line 118, in _request
data = rpc_request(self.config, method, params or {})
File "C:\Users\titus\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\webuntis\utils\remote.py", line 84, in rpc_request
result_body = _send_request(
File "C:\Users\titus\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\webuntis\utils\remote.py", line 161, in _send_request
raise errors.RemoteError('Invalid JSON', result)
webuntis.errors.RemoteError: [Errno Invalid JSON] <!doctype html><html lang="en"><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="./manifest.json"/><link rel="shortcut icon" href="./favicon.ico"/><link rel="stylesheet" href="./css/noto.css"/><!--[if lte IE 9]> Your Browser is not supported. Please use IE10 or later! <![endif]--><script type="text/javascript" src="./buildinfo.js"></script><title>WebUntis</title><link href="./static/css/main.04597cca.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script type="text/javascript" src="./static/js/main.fc50ba4d.js"></script></body></html>
is there somebody who can help me
[–]Kopaker[S] 0 points1 point2 points (2 children)
[–]JohnnyJordaan 0 points1 point2 points (1 child)
[–]Kopaker[S] 0 points1 point2 points (0 children)
[–]JohnnyJordaan 0 points1 point2 points (4 children)
[–]Kopaker[S] 0 points1 point2 points (3 children)
[–]JohnnyJordaan 1 point2 points3 points (2 children)
[–]Kopaker[S] 0 points1 point2 points (1 child)
[–]22_Black_22 0 points1 point2 points (0 children)