Sign inSign up

flame123/chrome-selenium

By flame123

•Updated almost 5 years ago

Ubuntu16.04 with Python3.5 and pytesseract,chrome-brower,chromdriver, selenium

Image
1

238

flame123/chrome-selenium repository overview

⁠Includes:

  • Python3.5
  • Google Chrome
  • Chromedriver
  • Selenium (in some versions)
  • pytesseract ( tesseract-ocr )

⁠Dockerfile

  CMD python3  /app/app.py

⁠example to test

# to test chrome-headless
docker run  flame123/chrome-selenium  google-chrome  --headless  --no-sandbox  --dump-dom  https://www.baidu.com

# to run host workdir app.py
docker run -v $PWD:/app  flame123/chrome-selenium   

#to run an autorun /app/app.py
docker run -d  flame123/chrome-selenium 

⁠python to test

#coding=utf-8 

import os
from selenium import webdriver


chrome_options= webdriver.ChromeOptions()
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--headless')
chrome_options.add_argument('--disable-gpu')


browser=webdriver.Chrome(chrome_options=chrome_options)

browser.get("https://www.baidu.com") 
print(browser.title);

#print(browser.page_source);
#browser.save_screenshot('example.png')

Tag summary

Content type

Image

Digest

Size

383.7 MB

Last updated

about 7 years ago

docker pull flame123/chrome-selenium