Question: I have searched a lot for this but couldn't find a solution. Here's [a similar question](https://stackoverflow.com/questions/10848900/how-to-take-partial-screenshot-frame-with-selenium-webdriver) with a possible solution in java.

Is there a similar solution in Python?

Answer: 
**Screenshot by Element:** 

```
from PIL import Image
from io import BytesIO

image = self.browser.driver.find_element_by_class_name('example.bla.bla').screenshot_as_png
im = Image.open(BytesIO(image))  # uses PIL library to open image in memory
im.save('example.png')

```
Just simple as that:

```
element = driver.find_element_by_class_name('myclass')
element.screenshot('screenshot.png')

```