How to get chromedriver persistent in HA OS?

Hello ,

I need to use the chromedriver to fetch a csv file containing measurements from my heating company.
Managed to automate this process on my PC using the chromedriver + selenium.
I found the following code on stackoverflow that installs the chromedriver on HA OS:

apk update && apk add --no-cache bash \
        alsa-lib \
        at-spi2-atk \
        atk \
        cairo \
        cups-libs \
        dbus-libs \
        eudev-libs \
        expat \
        flac \
        gdk-pixbuf \
        glib \
        libgcc \
        libjpeg-turbo \
        libpng \
        libwebp \
        libx11 \
        libxcomposite \
        libxdamage \
        libxext \
        libxfixes \
        tzdata \
        libexif \
        udev \
        xvfb \
        zlib-dev \
        chromium \
        chromium-chromedriver

But… As you know changes doesnt persist in HA OS , so my questions is - does anyone know how I can use the chromedriver with HA OS and automate a simple python script that downloads a CSV file?

If you are using HA OS you may be able to achieve this using a custom Add On:

If I may question the premise of your query:

Is the CSV file you are trying to download behind some kind of authentication? Does the CSV file name change? Are you not able determine the pattern if it does change? If no to all of those you could just use wget and use the path to download the file.

If yes, it may still be possible to retrieve the file without having to emulate a browser. You could potentially make a web request to retrieve an authentication token and use it to make the request for the file.

It all depends on how your heating company has their website set up.

Hi @jgoakley , I ended up installing a new raspberry pi OS and then a supervised installation of home assistant . Now I can do all my webdriver stuff on the host OS and still enjoy the full experience of home assistant . Yes it is behind authentication. Trust me I really didnt want to emulate a webbrowser but I simply couldn’t make sense of the heating company’s API and therefore I couldn’t access the csv file in any other way .

Glad you were able to find a solution that worked for you! I see your dilemma, sometimes it’s not even feasible to use their API so your solution is probably the best approach.