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: 
Worked for me in python3.5

```
from selenium import webdriver

fox = webdriver.Firefox()
fox.get('http://stackoverflow.com/')
image = fox.find_element_by_id('hlogo').screenshot_as_png

```

p.s.

To save to file

```
image=driver.find_element_by_id('hlogo').screenshot(output_file_path)

```
Just simple as that:

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

```