Skip to content

Instantly share code, notes, and snippets.

@ishideo
Created October 20, 2016 06:21
Show Gist options
  • Save ishideo/bb1c8408f9a580ac945f0a33b6444aef to your computer and use it in GitHub Desktop.
Save ishideo/bb1c8408f9a580ac945f0a33b6444aef to your computer and use it in GitHub Desktop.
import os
from selenium import webdriver
URL = "https://www.google.com"
FILENAME = os.path.join(os.path.dirname(os.path.abspath(__file__)), "screen.png")
browser = webdriver.PhantomJS()
driver = webdriver.PhantomJS()
driver.set_window_size(1280, 720)
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