location = element.location
size = element.size
fox.save_screenshot('screenshot.png')
fox.quit()
im = Image.open('screenshot.png')
left = location['x']
top = location['y']
right = location['x'] + size['width']
bottom = location['y'] + size['height']
im = im.crop((left, top, right, bottom))
im.save('screenshot.png')
How to take partial screenshot with Selenium WebDriver in python?