How to use the sma.files.screenshot_path function in sma

To help you get started, we’ve selected a few sma examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sdockray / sma / sma / sponge.py View on Github external
def screenshot(url, force=False):
	path = files.screenshot_path(url)
	if not os.path.exists(path):
		driver = webdriver.PhantomJS()
		driver.set_window_size(1024, 768)
		driver.get(url)
		driver.save_screenshot(path)
		files.square_crop(path)
	files.thumbnail(path)
	return path
	#print "Screenshot saved to: ",filepath