Need help fixing this Ui.Vision script

Job ID: 36481074

Budget: $15 – $50 USD

I am looking for someone to help me fix a Ui.Vision script. My goal is to call the ocr.space ocr api directly from within Ui.Vision RPA software.

Line1: executeScript |
async function callOCR() {
const apiKey = "helloworld";
const imageurl = "https://ui.vision/Content/Images/ui.vision.logo2.webp";
const ocrUrl = "https://api.ocr.space/parse/image";

const response = await fetch(ocrUrl, {
method: "POST",
headers: {
"Content-Type": "application/json",
"apikey": apiKey
},
body: JSON.stringify({
"language": "eng",
"ocrengine": 2,
"url": imageurl })
});

const data = await response.json();
}
callOCR();
return data; | result

Line2: echo | result is ${result} | green

As you can see, the issue is to get the Javascript inside the executeScript (https://ui.vision/rpa/docs/selenium-ide/executescript ) command to work. The Ui.Vision RPA software is open-source and free, and the ocr api key used in this test case is free, too.

Goal is that the ${result} variable should have the "ParsedText" info from the ocr api JSON response.
Related categories: JavaScript OCR AI/RPA development Selenium