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.

Get html source faster then with RetrieveHTML?

Post Reply
vitaliy_zh
Posts: 8
Joined: Thu Apr 02, 2020 2:28 pm

Get html source faster then with RetrieveHTML?

Post by vitaliy_zh »

Hello,
Is there a way to get the HTML of the main frame faster than RetrieveHTML?
Thanks!
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Get html source faster then with RetrieveHTML?

Post by salvadordf »

You can also use a filter to intercept the HTML contents even before they are rendered.
See the ResponseFilterBrowser demo for the details.
vitaliy_zh
Posts: 8
Joined: Thu Apr 02, 2020 2:28 pm

Re: Get html source faster then with RetrieveHTML?

Post by vitaliy_zh »

Hi salvadordf,

thank You for this example! I've looked closely at the project, but unfortunately I couldn't find the right place in the code that could help me.

Could You maybe be so kind and point me to the right place in the code or post a small example here?

My job is the following: I load a page and have to get the HTML of the Mainframe ASAP. Other frames and resources are not care. From my point of view the loading can even be canceled as soon as I have the HTML of the mainframe.

Many thanks in advance!
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Get html source faster then with RetrieveHTML?

Post by salvadordf »

If you don't want to render the page and you can ignore the rest of the resources then all you need is to use the code in the URLRequest demo to create a GET request.

...or even easier, use a THTTPClient or Indy to download the HTML.
Post Reply