Here they asked a similar question, and the answer seems more complete, I leave the source:
How to take partial screenshot with Selenium WebDriver in python?
from selenium import webdriverfrom PIL import Imagefrom io import BytesIOfox = webdriver.Firefox()fox.get('http://stackoverflow.com/')# now that we have the preliminary stuff out of the way time to get that image :Delement = fox.find_element_by_id('hlogo') # find part of the page you want image oflocation = element.locationsize = element.sizepng = fox.get_screenshot_as_png() # saves screenshot of entire pagefox.quit()im = Image.open(BytesIO(png)) # uses PIL library to open image in memoryleft = location['x']top = location['y']right = location['x'] + size['width']bottom = location['y'] + size['height']im = im.crop((left, top, right, bottom)) # defines crop pointsim.save('screenshot.png') # saves new cropped image