Hey all,
Given that we can now use conda
to install packages on Streamlit Share (see it here), we can install firefox-esr
via packages.txt
(as mentioned by @ferdie you need a browser to be installed for the webdriver) and install geckodriver
through conda (here’s the package).
Then we need to hardcode the path to geckodriver
in the conda environment:
firefoxOptions = Options()
firefoxOptions.add_argument("--headless")
driver = webdriver.Firefox(
options=firefoxOptions,
executable_path="/home/appuser/.conda/bin/geckodriver",
)
driver.get(URL)
This geckodriver
, as opposed to an executable pushed from Github repo, can be used by the app and…I think it works, I think it works I think it does, at least I can query the Unibet tables I’ll let you test further.
I can’t guarantee it will work forever if the Cloud team decides to change the path to the conda environment then you’ll have to look for it.
App: https://share.streamlit.io/andfanilo/s4a-selenium/main/app.py
Code: GitHub - andfanilo/s4a-selenium: Test Selenium + Firefox on Streamlit Share
Cheers,
Fanilo