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!
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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.