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.

RetrieveHTML provides an html that appears to confound IHTMLDocument2

Post Reply
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: RetrieveHTML provides an html that appears to confound IHTMLDocument2

Post by salvadordf »

Hi,

The MiniBrowser demo has a context menu option to "Copy HTML to clipboard" and the HTML that I get from ibm.com has several "A" tags.

Perhaps IHTMLDocument2 is having some issues with that HTML or the IBM page you see is different. They send localized content.
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: RetrieveHTML provides an html that appears to confound IHTMLDocument2

Post by salvadordf »

You have 2 alternatives :
  • Use the code in the DOMVisitor demo to search for the A tags using the CEF functions and classes.
  • Use JavaScript to search the A elements and send the results to Delphi. You can use the JSRTTIExtension demo to know how to send that information to Delphi.
Some websites send different HTML contents if you use Internet Explorer. Perhaps you see a different number of A elements because you're using Chromium now.

You would also need to configure TChromium to use the same preferred languages as IE or you might receive different HTML contents.
Post Reply