pywinauto客户端自动化---窗口进行截图
做自动化过程中时长会遇到一些截图操作,那么在做客户端的时候,应该怎么进行截图呢? 窗口截图 在pywinauto中存在自带的截图函数 capture_as_image() 源码: def capture_as_image(self, rect= None): """ Return a PIL image of the control. See PIL documentation to know what you can do with the resulting image. """ control_rectangle = self.rectangle() if not (control_rectangle.width() and control_rectangle.height()): return None # PIL is optional so check first if not ImageGrab: print ( " PIL does not seem to be installed. " " PIL is required for capture_as_image " ) self.actions.log( " PIL does not seem to be installed. " " PIL is required for capture_as_image