You can use a for loop in which you can save the screenshot as the 'i'th iteration.
Something like screenshot.save((r'./screenshot'+i+'.png'))
You might want to make a separate folder to store the screenshots to keep everything clean.
Then you can use OpenCV and tesseract to read the image that you just made by using the same formula as before (r'./screenshot'+i+'.png').
您可以使用pyautogui。它具有内置的屏幕截图功能。
You can use a for loop in which you can save the screenshot as the 'i'th iteration. Something like
screenshot.save((r'./screenshot'+i+'.png'))
You might want to make a separate folder to store the screenshots to keep everything clean. Then you can use OpenCV and tesseract to read the image that you just made by using the same formula as before (r'./screenshot'+i+'.png').我应该说,这可能不够快,无法每1-2秒执行一次。我仍然要测试,所以我不能说花费时间。至于只看屏幕的特定部分,也许可以将其放大,但是如果有人有更好的方法,请告诉我,我将更新答案。如果您知道如何使其更快,则与相同。
请告诉我您是否可以改进它。