Skip to content

sasa-tomic/selenium-python-xvfb

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

forked from pimuzzo/selenium-python-xvfb:


Useful Docker container image

Forked from: khozzy/selenium-python-chrome

BUILD IMAGE:

You can choose between:

1) Build from Dockerfile:

docker build -t selenium . (in the same path of your Dockerfile)

2) Pull it from docker hub:

docker pull pimuzzo/selenium-python-xvfb

RUN CONTAINER:

You can choose between:

1) Joining inside

docker run --name selenium -ti pimuzzo/selenium-python-xvfb bash

2) Using from outside

docker run -ti -v /your_local_dir:/home/something pimuzzo/selenium-python-xvfb python /home/something/your_file.py

Optional:

  • You can specify the browser with the BROWSER environment variable

EXAMPLE OF CODE WITH SELENIUM:

#!/usr/bin/env python

from pyvirtualdisplay import Display
from selenium import webdriver

display = Display(visible=0, size=(800, 600))
display.start()

# now Firefox will run in a virtual display. 
# you will not see the browser.
browser = webdriver.Firefox()
browser.get('http://www.google.com')
print browser.title
browser.quit()

display.stop()

source: http://goo.gl/cmLS9Z

About

Dockerfile for python Selenium container

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 74.6%
  • Python 19.4%
  • Shell 6.0%