Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

RetrieveText

Post Reply
jc4golf
Posts: 32
Joined: Wed Jun 23, 2021 12:33 am

RetrieveText

Post 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.
User avatar
salvadordf
Posts: 4620
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: RetrieveText

Post 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.
jc4golf
Posts: 32
Joined: Wed Jun 23, 2021 12:33 am

Re: RetrieveText

Post by jc4golf »

Thank you, Salvador, good work. But as an aside, I still wish I could get SimulateKeyEvent() to work.
Post Reply