Domanda

I want to read the image from url link or local and check if that certain text exist in that image.I am running a QTP tool to check all the image links in our website which has certain text since there are lot of image, i can not list all and check one by one. It is really time consuming. So I am looking for some alternatives to do it.

step 1: Read Image from url

step 2: check if image has certain text "test"

step 3: if it has a text "test" store the link , otherwise dont store

step 4: continue process for all image url

I am looking for some solution which provide API so that I can use it in code. It can be any language PHP, JS etc.

I have already tried i2ocr but it is not reading exactly also it does not have API. I also found this cloud.ocrsdk.com but this is also not accurate.

Does anyone know how to do this? Appreciate your help

È stato utile?

Soluzione

Below code is basic code in QTP which seems to work. I am using i2OCR.

systemutil.Run "iexplore.exe", "http://www.i2ocr.com"
'sync the browser
Browser("title:=.*").Sync

Sendkeys("{f5}")

Browser("i2OCR - Free Online OCR").Page("i2OCR - Free Online OCR").WebRadioGroup("i2ocr_options").Select "url" @@ hightlight id_;_Browser("i2OCR - Free Online OCR").Page("i2OCR - Free Online OCR").WebRadioGroup("i2ocr options")_;_script infofile_;_ZIP::ssf19.xml_;_
'imagetest.example.com/files/Image.png
Browser("i2OCR - Free Online OCR").Page("i2OCR - Free Online OCR").WebEdit("i2ocr_url").Set "http://imagetest.example.com/files/Image.png" @@ hightlight id_;_Browser("i2OCR - Free Online OCR").Page("i2OCR - Free Online OCR").WebEdit("i2ocr url")_;_script infofile_;_ZIP::ssf20.xml_;_
Browser("i2OCR - Free Online OCR").Page("i2OCR - Free Online OCR").WebButton("Extract Text").Click @@ hightlight id_;_Browser("i2OCR - Free Online OCR").Page("i2OCR - Free Online OCR").WebButton("Extract Text")_;_script infofile_;_ZIP::ssf21.xml_;_


a = Browser("title:=.*").Page("title:=.*").webedit("class:=i2ocr_iTextArea").GetROProperty("innertext")
msgbox a

If there is better way or better option, please let me know

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top