Created
October 13, 2016 02:29
-
-
Save ishideo/adc880fa62615211c4159118813857a6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
from selenium import webdriver | |
from pyvirtualdisplay import Display | |
URL = "https://www.github.com/" | |
FILENAME = os.path.join(os.path.dirname(os.path.abspath(__file__)), "screen.png") | |
display = Display(visible=0, size=(1024, 768)) | |
display.start() | |
driver = webdriver.Firefox() | |
driver.set_window_size(1024, 768) | |
driver.get(URL) | |
driver.save_screenshot(FILENAME) | |
driver.quit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment