All Projects → joyzoursky → Docker Python Chromedriver

joyzoursky / Docker Python Chromedriver

Licence: mit
Dockerfile for running Python Selenium in headless Chrome (Python 2.7 / 3.6 / 3.7 / 3.8 / Alpine based Python / Chromedriver / Selenium / Xvfb included in different versions)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Docker Python Chromedriver

headless-chrome
Implementation of the new headless chrome with chromedriver and selenium.
Stars: ✭ 34 (-91.17%)
Mutual labels:  selenium, chromedriver, headless-chrome
Insta-Bot
Python bot using Selenium increasing Instagram Followers.
Stars: ✭ 62 (-83.9%)
Mutual labels:  selenium, chromedriver
pyderman
Install Selenium-compatible Chrome/Firefox/Opera/PhantomJS/Edge webdrivers automatically.
Stars: ✭ 24 (-93.77%)
Mutual labels:  selenium, chromedriver
yt-videos-list
Create and **automatically** update a list of all videos on a YouTube channel (in txt/csv/md form) via YouTube bot with end-to-end web scraping - no API tokens required. Multi-threaded support for YouTube videos list updates.
Stars: ✭ 64 (-83.38%)
Mutual labels:  selenium, chromedriver
TikTok
Download public videos on TikTok using Python with Selenium
Stars: ✭ 37 (-90.39%)
Mutual labels:  selenium, chromedriver
throughout
🎪 End-to-end testing made simple (using Jest and Puppeteer)
Stars: ✭ 16 (-95.84%)
Mutual labels:  selenium, headless-chrome
dusker
Stand alone Laravel Dusk test suit, which do not require Laravel framework itself
Stars: ✭ 28 (-92.73%)
Mutual labels:  selenium, chromedriver
jest-selenium
This project shows how to drive your selenium tests with Jest.
Stars: ✭ 22 (-94.29%)
Mutual labels:  selenium, chromedriver
whatabomb
A whatsapp bombing GUI Script
Stars: ✭ 84 (-78.18%)
Mutual labels:  selenium, chromedriver
dockerfile
A collection of dockerfile I use
Stars: ✭ 90 (-76.62%)
Mutual labels:  chromedriver, headless-chrome
docker-selenium-lambda
The simplest demo of chrome automation by python and selenium in AWS Lambda
Stars: ✭ 172 (-55.32%)
Mutual labels:  selenium, chromedriver
Node Chromedriver
An installer and wrapper for Chromedriver.
Stars: ✭ 378 (-1.82%)
Mutual labels:  selenium, chromedriver
chameleon-crawler
Browser automation for Chameleon.
Stars: ✭ 17 (-95.58%)
Mutual labels:  selenium, chromedriver
devtools-proxy
Multiplexing proxy for Chrome DevTools. Fully compatible with Selenium and ChromeDriver
Stars: ✭ 64 (-83.38%)
Mutual labels:  selenium, chromedriver
Fifa21-Autobidder
Selenium-based bot that autobids and autobuys players on FIFA 23 Ultimate Team's transfer market
Stars: ✭ 106 (-72.47%)
Mutual labels:  selenium, chromedriver
scribd-dl
Command-line program to download Scribd documents in pdf format
Stars: ✭ 23 (-94.03%)
Mutual labels:  selenium, chromedriver
Panther
A browser testing and web crawling library for PHP and Symfony
Stars: ✭ 2,480 (+544.16%)
Mutual labels:  selenium, chromedriver
Chromeless
🖥 Chrome automation made simple. Runs locally or headless on AWS Lambda.
Stars: ✭ 13,254 (+3342.6%)
Mutual labels:  selenium, headless-chrome
scf-headless-chrome
Headless chrome running on tencent serverless cloud function.
Stars: ✭ 28 (-92.73%)
Mutual labels:  selenium, headless-chrome
Playwright Go
Playwright for Go a browser automation library to control Chromium, Firefox and WebKit with a single API.
Stars: ✭ 272 (-29.35%)
Mutual labels:  selenium, headless-chrome

docker-python-chromedriver

Python with Chromedriver, for running automated tests

Quick Try

$ git clone https://github.com/joyzoursky/docker-python-chromedriver.git
$ cd docker-python-chromedriver
$ docker run -it -w /usr/workspace -v $(pwd):/usr/workspace joyzoursky/python-chromedriver:3.7 bash
/usr/wrokspace# pip install selenium
/usr/wrokspace# python test_script.py

Image includes

  • Python (Debian or Alpine based)
  • Google Chrome
  • Chromedriver
  • Selenium (in some versions)
  • Xvfb (in some versions)

Versions

Python 3 (Debian-based)

  • 3.8, latest (based on python:3.8, Dockerfile)
  • 3.8-selenium (based on python:3.8 with selenium installed, Dockerfile)
  • 3.7 (based on python:3.7, Dockerfile)
  • 3.7-selenium (based on python:3.7 with selenium installed, Dockerfile)
  • 3.6 (based on python:3.6, Dockerfile)
  • 3.6-selenium (based on python:3.6 with selenium installed, Dockerfile)

Python 3 (Alpine-based)

  • 3.8-alpine3.10 (based on python:3.8-alpine3.10, Dockerfile)
  • 3.8-alpine3.10-selenium (based on python:3.8-alpine3.10 with selenium installed, Dockerfile)
  • 3.7-alpine3.8 (based on python:3.7-alpine3.8, Dockerfile)
  • 3.7-alpine3.8-selenium (based on python:3.7-alpine3.8 with selenium installed, Dockerfile)
  • 3.6-alpine3.7 (based on python:3.6-alpine3.7, Dockerfile)
  • 3.6-alpine3.7-selenium (based on python:3.6-alpine3.7 with selenium installed, Dockerfile)

Python 2 (Deprecated)

  • 2.7 (based on python:2.7, Dockerfile)
  • 2.7-selenium (based on python:2.7 with selenium installed, Dockerfile)
  • 2.7-alpine3.7 (based on python:2.7-alpine3.7, Dockerfile)
  • 2.7-alpine3.7-selenium (based on python:2.7-alpine3.7 with selenium installed, Dockerfile)

Versions with Xvfb (Deprecated)

  • 3.6-xvfb (based on python:3.6 with xvfb installed, Dockerfile)
  • 3.6-xvfb-selenium (based on python:3.6 with xvfb and selenium installed, Dockerfile)
  • 2.7-xvfb (based on python:2.7 with xvfb installed, Dockerfile)
  • 2.7-xvfb-selenium (based on python:2.7 with xvfb and selenium installed, Dockerfile)

Usage

For the following Debian-based images:

  • latest
  • 3.8
  • 3.8-selenium
  • 3.7
  • 3.7-selenium
  • 3.6
  • 3.6-selenium
  • 3.6-xvfb
  • 3.6-xvfb-selenium
  • 2.7
  • 2.7-selenium
  • 2.7-xvfb
  • 2.7-xvfb-selenium

Run the followings in your terminal:

$ cd [your working directory]
$ docker run -it -w /usr/workspace -v $(pwd):/usr/workspace joyzoursky/python-chromedriver:[version] bash

For the following Alpine-based images:

  • 3.8-alpine3.10
  • 3.8-alpine3.10-selenium
  • 3.7-alpine3.8
  • 3.7-alpine3.8-selenium
  • 3.6-alpine3.7
  • 3.6-alpine3.7-selenium
  • 2.7-alpine3.7
  • 2.7-alpine3.7-selenium

Run the followings in your terminal:

$ cd [your working directory]
$ docker run -it -w /usr/workspace -v $(pwd):/usr/workspace joyzoursky/python-chromedriver:[version] sh

This will create a container from the image. Then you could starting running the commands in the container as in your working directory. The followings are some examples to run a selenium test.

Examples to run selenium test in the container

You can download a selenium test example from here to quick start.

For the following images with selenium pre-installed:

  • 3.8-alpine3.10-selenium
  • 3.8-selenium
  • 3.7-alpine3.8-selenium
  • 3.7-selenium
  • 3.6-alpine3.7-selenium
  • 3.6-selenium
  • 2.7-alpine3.7-selenium
  • 2.7-selenium

You may run:

# python test_script.py

For the following images that do not have selenium pre-installed:

  • latest
  • 3.8-alpine3.10
  • 3.8
  • 3.7-alpine3.8
  • 3.7
  • 3.6-alpine3.7
  • 3.6
  • 2.7-alpine3.7
  • 2.7

You may run:

# pip install selenium
# python test_script.py

For 3.6-xvfb or 2.7-xvfb, you may run:

# pip install selenium
# xvfb-run --server-args="-screen 0 1024x768x24" python test_script.py

For 3.6-xvfb-selenium or 2.7-xvfb-selenium, you may run:

# xvfb-run --server-args="-screen 0 1024x768x24" python test_script.py

Then you should see the test result like this:

test_case_1 (__main__.TestTemplate)
Find and click top-right button ... ok
test_case_2 (__main__.TestTemplate)
Find and click Learn more button ... ok

----------------------------------------------------------------------
Ran 2 tests in 8.684s

OK

Contributing

To make changes upon the existing Dockerfiles, you are suggested to edit upon the Dockerfile.template files, and generate the new Dockerfiles for different versions by running render.sh.

How to edit and generate new versions of Dockerfiles

  1. cd to the folder that you want to edit, e.g. py-debian
  2. Make changes upon Dockerfile.template or Dockerfile-selenium.template
  3. Run bash render.sh from command-line

Note: The render.sh is written for Mac OS; If you are using Windows or other OS, some commands may need to be optimised before running.

Thanks a lot for helping on improving this project!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].