Sign inSign up

eresseel/selenium-chrome

By eresseel

Updated about 4 years ago

Selenium is a suite of tools for automating web browsers.

Image
0

419

eresseel/selenium-chrome repository overview

selenium-chrome-image

Selenium is a suite of tools for automating web browsers.

Available Docker image versions

The following Selenium Docker images are as small as possible and only contain Selenium and Chrome browser itself.

Docker tagDebian fromPython fromBuild from
latestDebian BusterPython 3.10.6Latest stable Selenium version
4.4.3Debian BusterPython 3.10.6Selenium 4.4.3 version

Docker run commands

docker run --rm -it -v ${PWD}:/ws -w /ws eresseel/selenium-chrome:latest bash

Selenium test example

import unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options

class SeleniumTest(unittest.TestCase):
    def setUp(self):
        options = Options()
        options.add_argument('--no-sandbox')
        options.add_argument('--disable-gpu')
        options.add_argument("headless")
        options.add_argument("--window-size=1920,1080")
        self.driver = webdriver.Chrome(options=options)

    
    def test_title(self):
        driver = self.driver
        driver.get("https://www.python.org/")

        self.assertIn("Welcome to Python.org", driver.title.text)


    def tearDown(self):
        self.driver.close()

if __name__ == "__main__":
    unittest.main()

Tag summary

Content type

Image

Digest

sha256:6cdfd6839

Size

563.5 MB

Last updated

about 4 years ago

docker pull eresseel/selenium-chrome