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.
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.
RetrieveText
- salvadordf
- Posts: 4620
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: RetrieveText
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.
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
Thank you, Salvador, good work. But as an aside, I still wish I could get SimulateKeyEvent() to work.