I was given a small data entry job in which I had to type 2000 data and I had to do this in a specific software. Problem is that I typed almost 200 data in that software and I came to know that the software which that guy gave me does not support Copy/Paste.
And i write a code to screenshot the data and convert to text with the help of OCR .
THIS IS THE CODE it automatic write text and go to next line end of the application ask to captcha that i do manually
import pytesseract as tess
from PIL import Image
import pyautogui
import time
import keyboard
textList= []
x = 1
def shot():
time.sleep(5)
im = pyautogui.screenshot(region=(0,65,1300,290))
im.save('image.png')
print('ScreenShot Done ...........')
translate()
def translate():
tess.pytesseract.tesseract_cmd = r'C:\\Program Files\\Tesseract-OCR\\tesseract.exe'
img = Image.open("C:\\Users\\anshe\\Pictures\\file30.png")
text = tess.image_to_string(img)
global textList
textList = list(filter(None, text.splitlines()))
while textList.count(' '):
textList.remove(' ')
print("translate Done")
time.sleep(2)
def main():
while len(textList) != 0:
for data in textList:
for char in data:
pyautogui.press(char)
time.sleep(.5)
pyautogui.press('tab')
pyautogui.PAUSE('esc')
print("Going to SHot")
shot()
print("Start...")
while x <= 100:
main()
x = x+1
i have to complete 100 data per day... Please help me....
Ansheer R.
but windows 10 on keyboard screen is working in that software but my programme is not ..11/25/20