[Python] Can python get the screen shot of a specific window?

Discussão em 'Python' iniciado por Stack, Março 9, 2025.

  1. Stack

    Stack Membro Participativo

    For example, I am running a java program. Can I use python to get the content(screenshot) of this java program? Not the full screen, just the java program.

    I have seen this module, but it required a parameter of "where the program window is":

    import pyscreenshot as ImageGrab

    if __name__ == "__main__":
    # part of the screen
    im=ImageGrab.grab(bbox=(10,10,510,510)) # X1,Y1,X2,Y2
    im.show()
    #-#


    But this may not be what I am seeking since it requires the bounding_box.

    Continue reading...

Compartilhe esta Página