fix: retry dismiss welcome + update to bookworm

This commit is contained in:
Gabriel Augendre 2023-06-15 22:45:07 +02:00
parent 7494f4e51b
commit 85c36bc14f
4 changed files with 12 additions and 10 deletions

View file

@ -7,9 +7,9 @@ RUN wget -q https://github.com/mozilla/geckodriver/releases/download/$GECKODRIVE
&& tar xvf $GECKODRIVER_FILENAME \ && tar xvf $GECKODRIVER_FILENAME \
&& rm $GECKODRIVER_FILENAME && rm $GECKODRIVER_FILENAME
FROM python:3.11-slim-bullseye as final FROM python:3.11-slim-bookworm as final
RUN apt-get update && apt-get install -y firefox-esr RUN apt-get update && apt-get install -y firefox-esr
COPY --from=downloader /app/geckodriver /usr/local/bin/geckodriver COPY --from=downloader /app/geckodriver /usr/local/bin/geckodriver
ARG OFX_VERSION ARG OFX_VERSION
RUN pip install ofx-processor==$OFX_VERSION RUN pip --disable-pip-version-check install ofx-processor==$OFX_VERSION
CMD ["ynab", "lcl", "--download"] CMD ["ynab", "lcl", "--download"]

BIN
error_download_lcl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

View file

@ -62,13 +62,15 @@ class LclDownloader:
self._click(By.CLASS_NAME, "app-cta-button") self._click(By.CLASS_NAME, "app-cta-button")
click.secho("Logged in!", fg="green") click.secho("Logged in!", fg="green")
time.sleep(2) retry = True
try: while retry:
self._click(By.CSS_SELECTOR, ".app-cta-button--primary") try:
click.secho("Dismissing welcome screen...", fg="blue") self._click(By.CSS_SELECTOR, ".app-cta-button--primary")
time.sleep(2) click.secho("Dismissing welcome screen...", fg="blue")
except NoSuchElementException: time.sleep(1)
click.secho("No welcome screen found.", fg="blue") except NoSuchElementException:
click.secho("No welcome screen found.", fg="blue")
retry = False
try: try:
self._click(By.CSS_SELECTOR, ".burger-menu-content") self._click(By.CSS_SELECTOR, ".burger-menu-content")

View file

@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "ofx-processor" name = "ofx-processor"
version = "4.4.5" version = "4.4.6"
description = "Personal ofx processor" description = "Personal ofx processor"
readme = "README.md" readme = "README.md"
authors = ["Gabriel Augendre <gabriel@augendre.info>"] authors = ["Gabriel Augendre <gabriel@augendre.info>"]