Sign inSign up

agentlans/firefox-selenium

By agentlans

Updated over 2 years ago

Automate the Firefox browser with Python

Image
0

356

agentlans/firefox-selenium repository overview

What's included:

  • Firefox 100.0.2 installed on Debian
  • Selenium WebDriver
  • Python 3.9 bindings for Selenium

How to use

Acquire the Docker image:

docker pull agentlans/firefox-selenium

Start a temporary container from the image. By default, it goes to the Python prompt.

docker run --rm -it agentlans/firefox-selenium

You can also call Python from the container. If you want to run a Python script, you should copy the file into the container first.

docker run --rm -it agentlans/firefox-selenium python3 my_selenium_script.py

Try some Python code to make sure the Firefox driver works:

# Try running this code by copying and pasting to the Python prompt:
from selenium import webdriver
from selenium.webdriver.common.by import By  # for selecting HTML tags
from selenium.webdriver import FirefoxOptions

options = FirefoxOptions()
options.headless = True # No GUI
driver = webdriver.Firefox(options=options)

driver.get("https://www.google.com")

driver.title # => "Google"
driver.quit()

Author, License

The Dockerfile is Copyright ©️ 2022 Alan Tseng

GNU General Public License v3

Link to GitHub

The actual built image (that is, the one on Docker Hub) is covered by the licenses of Docker, Debian, Firefox, Python, and Selenium. Please see their websites for details.

Tag summary

Content type

Image

Digest

sha256:9116097f1

Size

358.7 MB

Last updated

over 2 years ago

docker pull agentlans/firefox-selenium