A
A
Amigun2019-01-02 10:12:22
Python
Amigun, 2019-01-02 10:12:22

How to write a python script that will take a screenshot of certain parts of the screen?

I connect the phone to the computer so that the image from the phone is transferred to the computer screen. I need the python script to take a screenshot of the screen at the right time for me, so that later I can use tesseract to recognize the text that is on the screenshot, so that I can google it later (the question appears on the phone, and will also be present on the screenshot). Further, through the custom search API, I will find out which of the answers suggested in the screenshot is more suitable as an answer to my question. But everything depends on creating a screenshot in the place I need on the monitor screen. Who can help create the script?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
A
Alexander, 2019-01-02
@NeiroNx

Again, some kind of crutch solution - probably a python script could connect to the phone itself and get a picture from it, regardless of the screenshot.

S
shurik1968, 2019-01-03
@shurik1968

https://pillow.readthedocs.io/en/latest/handbook/t...

E
Emil Revencu, 2019-01-10
@Revencu

pyautogui

P
Pavel Dunaev, 2019-01-10
@Pasha13666

You can take a screenshot on the device via adb:

adb shell screencap -p /sdcard/screen.png
adb pull /sdcard/screen.png
adb shell rm /sdcard/screen.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question