Skip to content

Instantly share code, notes, and snippets.

@ishideo
Created October 13, 2016 02:29
Show Gist options
  • Save ishideo/adc880fa62615211c4159118813857a6 to your computer and use it in GitHub Desktop.
Save ishideo/adc880fa62615211c4159118813857a6 to your computer and use it in GitHub Desktop.
#!/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