Meine Schule benutzt jetzt seit einiger Zeit WebUntis und ich möchte das gerne mit einem Programm auslesen.
Ich habe in so etwas allerdings nicht viel Erfahrung.
Ich habe das hier gefunden:
Code: Alles auswählen
import webuntis
s = webuntis.Session(
username='User',
password='Password',
server='webuntis.grupet.at:8080',
school='Schule',
useragent='UserAgent'
).login()
for klasse in s.klassen():
print(klasse.name)
Allerdings bekomme Ich diese Fehlermeldung
Vielleicht weiß ja jemand wie das Funktioniert oder hat eine Alternative.Traceback (most recent call last):
File "C:\Users\Tobias\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connection.py", line 160, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "C:\Users\Tobias\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\util\connection.py", line 61, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "C:\Users\Tobias\AppData\Local\Programs\Python\Python37\lib\socket.py", line 752, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Tobias\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 677, in urlopen
chunked=chunked,
File "C:\Users\Tobias\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 381, in _make_request
self._validate_conn(conn)
File "C:\Users\Tobias\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 976, in _validate_conn
conn.connect()
File "C:\Users\Tobias\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connection.py", line 308, in connect
conn = self._new_conn()
File "C:\Users\Tobias\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connection.py", line 172, in _new_conn
self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x000002B2AA76E348>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Tobias\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\adapters.py", line 449, in send
timeout=timeout
File "C:\Users\Tobias\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 725, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "C:\Users\Tobias\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\util\retry.py", line 439, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='webuntis.grupet.at', port=8080): Max retries exceeded with url: /WebUntis/jsonrpc.do?school=Gewerbliche%20Schule%20G%C3%B6ppingen (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000002B2AA76E348>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Tobias\Desktop\test.py", line 8, in <module>
useragent='Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:82.0) Gecko/20100101 Firefox/82.0'
File "C:\Users\Tobias\AppData\Local\Programs\Python\Python37\lib\site-packages\webuntis\session.py", line 95, in login
}, use_login_repeat=False)
File "C:\Users\Tobias\AppData\Local\Programs\Python\Python37\lib\site-packages\webuntis\session.py", line 118, in _request
data = rpc_request(self.config, method, params or {})
File "C:\Users\Tobias\AppData\Local\Programs\Python\Python37\lib\site-packages\webuntis\utils\remote.py", line 88, in rpc_request
http_session
File "C:\Users\Tobias\AppData\Local\Programs\Python\Python37\lib\site-packages\webuntis\utils\remote.py", line 153, in _send_request
r = http_session.post(url, data=json.dumps(data), headers=headers)
File "C:\Users\Tobias\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\sessions.py", line 578, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "C:\Users\Tobias\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\Tobias\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "C:\Users\Tobias\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='webuntis.grupet.at', port=8080): Max retries exceeded with url: /WebUntis/jsonrpc.do?school=Gewerbliche%20Schule%20G%C3%B6ppingen (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000002B2AA76E348>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))