diff --git a/Dockerfile b/Dockerfile index 7cc1534..7e03a92 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,13 @@ FROM python:3.7 -COPY bibcheck.py / -CMD ["python", "bibcheck.py"] +RUN useradd --create-home appuser + +COPY requirements.txt /home/appuser +RUN pip install -r /home/appuser/requirements.txt + + +WORKDIR /home/appuser +USER appuser + +COPY bibcheck.py ./ +CMD ["python", "./bibcheck.py"] diff --git a/bibcheck.py b/bibcheck.py index 2fa09da..e0ff861 100644 --- a/bibcheck.py +++ b/bibcheck.py @@ -19,6 +19,8 @@ def main(): response = br.submit() br.follow_link(text_regex=r"Konto") response = br.follow_link(text_regex=r"Ausleihe zeigen") + br.select_form('Form0') + response = br.submit(name='textButton$0', label='Alle verlängern') lentlist = bs4.BeautifulSoup(response.read(), 'html.parser') table = lentlist.select('table[class="rTable_table"]')[0] allinfo = [] diff --git a/requirements.txt b/requirements.txt index f05f949..b4b3331 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ beautifulsoup4==4.8.0 -bs4==0.0.1 certifi==2019.9.11 chardet==3.0.4 html5lib==1.0.1