How to install google-chrome on the app platform to run selenium?
I used the typical selenium setup for running selenium:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
def chrome_initializer():
service = Service(executable_path=ChromeDriverManager().install())
options = Options()
options.add_argument("--no-sandbox")
options.add_argument("--headless")
driver = webdriver.Chrome(options=options, service=service)
driver.get('https://httpbin.org/headers')
source = driver.page_source
print(source)
However, I get the following issue:
[WDM] - Could not get version for google-chrome. Is google-chrome installed?
[WDM] - Get LATEST chromedriver version for None google-chrome
[WDM] - Driver [/workspace/.wdm/drivers/chromedriver/linux64/102.0.5005.61/chromedriver] found in cache
It manages to get the chromedriver but I could not find a way to install google-chrome without a dropplet.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Enter your email to get $200 in credit for your first 60 days with DigitalOcean.
New accounts only. By submitting your email you agree to our Privacy Policy.
Hi there,
I think that installing this directly on the App Platform would not be possible, but what you could try is using a Dockerfile to deploy your app.
That way you should be able to specify the package installation in your Dockerfile and the App Platform will build that image for you with the package included.
You could use the following as the base image:
https://hub.docker.com/r/selenium/standalone-chrome
Best,
Bobby