Whitebox Tests

This commit is contained in:
2024-06-03 11:51:05 +02:00
parent 9fa7cfe867
commit 2027397e03
5 changed files with 70 additions and 15 deletions

View File

@ -57,7 +57,10 @@ async def getKurs(token: int, cookie: str):
response = await s.get(url=f"{url}?APPNAME=CampusNet&PRGNAME=COURSERESULTS&ARGUMENTS=-N{token},-N000307,",
headers=headers)
html = BeautifulSoup(response.text, 'lxml')
link = html.body.find('a', attrs={'id': "Popup_details0001"})['href']
try:
link = html.body.find('a', attrs={'id': "Popup_details0001"})['href']
except TypeError:
return 0
response = await s.get(url=f"{url}{link[21:]}", headers=headers)
html = BeautifulSoup(response.text, 'lxml')
content = html.body.find('td', attrs={'class': 'level02'}).text