def verify_OCR(url): download_file(url, 'ocr.png') pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files (x86)\Tesseract-OCR\tesseract' text_extracted = pytesseract.image_to_string( Image.open('../DownloadedFiles/TELE.png')) return text_extracted
def verify_online_pdf(url, text_to_verify): download_file(url, 'sample.pdf') pdfFileObject = open('../DownloadedFiles/sample.pdf', 'rb') pdfReader = PyPDF2.PdfFileReader(pdfFileObject) count = pdfReader.numPages for i in range(count): page = pdfReader.getPage(i) print(page.extractText()) if page.extractText().find(text_to_verify): print('Text found...')
from Utility.SilentDownloader import download_file from Utility.ImageCompare import compareImages download_file("https://www.google.lk/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png","google.png") compareImages("google.png","googlelogo_color_272x92dp.png")
from Utility.SilentDownloader import download_file download_file( "http://web.utk.edu/~archinfo/EcoDesign/escurriculum/PDF/Part_A.zip", "kushan.zip")
def verify_online_barcode(url): download_file(url, 'sample.png') text_d = decode(Image.open('../DownloadedFiles/sample.png')) return text_d