When using https://ocr.sanskritdictionary.com/ to upload an image, the copyable text appears in a Tinymce editor. I am looking for suggestions on how to copy the resulting text using Selenium JavaScript code.
I have attempted to extract it using the html body id of the text, but it was unsuccessful. I also tried the method recommended by Gemini, which did not work:
// Wait for the Tinymce editor to appear (adjust the timeout as needed)
const tinymceEditor = await driver.findElement(By.id(tinymceId));
await driver.wait(
() => tinymceEditor.isDisplayed(),
60000 // Wait for up to 10 seconds
);
// Execute JavaScript to get the content from the Tinymce editor
const text = await driver.executeScript(
'return document.getElementById("' + tinymceId + '").innerHTML;',
tinymceEditor
);
Any suggestions would be greatly appreciated. Thank you.