Anvil and Selenium - browser automation

Oh, I see - I thought the website was an Anvil app! If it’s dealing with an external website you’ll want a different approach.

I’m afraid we don’t currently support running Selenium on the Anvil servers (except for Dedicated Plan users) - it launches a whole browser, which uses a ridiculous amount of memory/CPU.

Two options come to mind:

  1. Running Selenium on another computer, using the Uplink. You can still trigger it from another user’s machine (from a FileLoader or from a client Uplink script), but the Selenium run happens on a computer you control - so you can just update the code in one place.

    (In this scenario, Anvil is working as an easy way to get files from your users’ computers to your server, rather than doing any of the processing in Anvil.)

  2. Reworking your automation to use requests and BeautifulSoup, which are supported in Anvil server modules.

1 Like