I have been using your platform for quite some time, and I find it excellent. I am interested in deploying Selenium on your cloud. I have tried all the Selenium examples provided by you on the cloud, but I keep encountering errors. Could you please provide me with a working Selenium code snippet?
The app worked stably for a very long time and still works in principle. But the target website has probably activated geoip blocking in the meantime. As a result, the content can no longer be viewed from the servers on which streamlit cloud is hosted. The app still worked locally in a docker container.
I have now reworked the app and added more debugging and error handling. I have also added the use of a proxy to bypass the geoip blocking. This means that the app works again on streamlit cloud. However, since only free proxies are used, this does not always work reliably.
Thank you this is awesome, I am having the same problem as @IlIl using selenium on community cloud. I have forked you app and have it running successfully on com cloud. But having trouble finding the element that I need (and works in my locally run version).
driver = get_driver()
runner = str(47595)
ParkrunURL = “https://www.parkrun.org.uk//parkrunner//” + runner + “//all//”
driver.implicitly_wait(10) # Wait for up to 10 seconds
try:
table = driver.find_element(By.XPATH, “(//table)[3]”)
st.write(‘we got it’)
except:
st.write(‘this table was not found’)
And don’t know if this is a Selenium problem or Streamlit problem?
Debugging selenium running on streamlit cloud is a bit of a nightmare…
Make sure that you actually get the html page you want and not a 403 or 404 response.
Could be that the target webserver has ip/geoip blocking enabled.
which runs without error and writes the correct URL on the app.
And the ‘try’ block works if I just ask it to write something, but if I try any ‘find_element’. I get this error
raise WebDriverException(f"Service {self._path} unexpectedly exited. Status code was: {return_code}")
selenium.common.exceptions.WebDriverException: Message: Service /home/appuser/.cache/selenium/chromedriver/linux64/122.0.6261.94/chromedriver unexpectedly exited. Status code was: 1
I have also tried adding driver.implicitly_wait(10) and copying the short and full XPath from the website, but still no joy
This does not mean that you get the desired content of the website. Look at the actual html content you get and the status code. To do this you need to add more debug code.
Look at the actual content you get back and the status code.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.