Web Scraping With Selenium in a Docker Container

17 Views Asked by At

I've been using selenium for web scraping and it has been working fine and now I'm trying to dockerize the code but I get the WebDriverException error even after provide the latest chrome extension folder path.

    driver = webdriver.Chrome(options=options)
    driver = webdriver.Remote(command_executor = "http://localhost:4444",options=options)
    driver = webdriver.Chrome('/chromedriver_linux64')
    driver = webdriver.Chrome(options=options)
    driver.get(link)

Tried all possible ways, even selenium-docker wasn't working

File "/Applications/anaconda3/lib/python3.11/site-packages/selenium/webdriver/common/service.py", line 203, in _start_process raise WebDriverException( selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://chromedriver.chromium.org/home

I need Docker solution or a way to get my code to access chrome or any browser while running in my container

0

There are 0 best solutions below