ishideo
10/20/2016 - 6:21 AM

screenshot_phantomjs.py

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()