mirror of
https://github.com/Garmelon/PFERD.git
synced 2026-04-12 07:25:04 +02:00
Implement ILIAS auth and crawl home page
This commit introduces the necessary machinery to authenticate with ILIAS and crawl the home page. It can't do much yet and just silently fetches the homepage.
This commit is contained in:
parent
595de88d96
commit
b2a2b5999b
4 changed files with 221 additions and 0 deletions
|
|
@ -4,6 +4,8 @@ import functools
|
|||
import getpass
|
||||
from typing import Any, Callable, Optional, TypeVar
|
||||
|
||||
import bs4
|
||||
|
||||
T = TypeVar("T")
|
||||
|
||||
|
||||
|
|
@ -23,6 +25,12 @@ async def ainput(prompt: str) -> str:
|
|||
async def agetpass(prompt: str) -> str:
|
||||
return await to_thread(lambda: getpass.getpass(prompt))
|
||||
|
||||
def soupify(data: bytes) -> bs4.BeautifulSoup:
|
||||
"""
|
||||
Parses HTML to a beautifulsoup object.
|
||||
"""
|
||||
|
||||
return bs4.BeautifulSoup(data, "html.parser")
|
||||
|
||||
async def prompt_yes_no(query: str, default: Optional[bool]) -> bool:
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue