Is it possible to have the ability to create a webdriver with an argument when deploying a project to a cloud service to be able to do button press interactions on any page? I mean, I want to retrieve some value from a page, but I need to press a button to retrieve it beforehand, what easy way to do it so that it doesn’t throw an error. On localhost it works, the problem is during cloud service.
from selenium.webdriver.firefox.options import Options
from selenium import webdriver
def setup_driver():
options = Options()
options.add_argument("--window-size=1920,1080")
driver = webdriver.Firefox(options=options)
return driver
Selenium/webdriver opens on your server machine. When you run an app locally, your server and client are coincidentally the same machine. When you deploy to Community Cloud (it generally any cloud service), your server becomes a remote machine. Therefore, when viewing your app (client), you’ll never see the selenium/webdriver windows.
So I think you’ll need a different approach unless I’ve misunderstood the basic premise.
I am not interested in seeing selenium/webdriver windows as a background user, I want it to automatically download some value,
I want it to automatically download some value which I will later want to display in the streamlit panel.
In this case, does anyone respect another possible approach to the problem possibly a solution?
Can you describe a bit more about pressing a button to retrieve something? Are you just meaning that you want the user on the front end to trigger a web crawl from a button click? I’m not understanding how the window size is related to the button press.
Meanwhile, do you have all the dependencies set up so that selenium is working on Community Cloud for the basic case?
Maybe I am misunderstood, but the issue is the --headless argument. I want the driver to be without this argument, i.e., if I open my script locally, the given page will be shown (the problem is on the cloud service, because the server machine does not have the ability to open a specific page as it is locally. I need the bot to press a button on a previously opened specific page or pages, and then when pressed, the given text will be visible, which I then download to a variable.
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.