'Get a screenshot of a specific window with pillow on macos

I am trying to take screenshots of a specific chrome window on my mac with python, (not the full screen, but just the chrome window)

I've seen some solutions for Windows, but none for mac yet. I think this is possible with pillow, but I'm not sure.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source