Page 1 of 1

RetrieveText

Posted: Tue Jun 25, 2024 3:19 pm
by jc4golf
I'm trying to use RetrieveText like I used it in CEF4Delphi to get data from a webpage, but I don't get the text I need. It looks like the HTML rather than text values. I'm using it in the NavigationCompleted procedure but perhaps the page hasn't fully loaded?

Edit: I answered part of my question by delaying RetrieveText which resulted in getting more text, but the text still looks like HTML without any of the text data I'm looking for.

Edit 2: I've solved the other part of my issue by modifying TWVBrowserBase.RetrieveText from "document.body.textContent" to "document.body.innerText". Then it works exactly like it did in CEF4Delphi.

Re: RetrieveText

Posted: Wed Jun 26, 2024 8:52 am
by salvadordf
Thanks for reporting this issue!

I just added a aVisibleTextOnly parameter to TWVBrowserBase.RetrieveText.

If you call TWVBrowserBase.RetrieveText(True) then it will use innerText instead of textContent.

Re: RetrieveText

Posted: Wed Jun 26, 2024 2:00 pm
by jc4golf
Thank you, Salvador, good work. But as an aside, I still wish I could get SimulateKeyEvent() to work.