Click here to Skip to main content
15,894,646 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am using CefSharp library to in Windows Form application to render HTML. Initially i was using Web Browser control but sometimes it creates problem on few URL.

Now i want to retrieve the full HTML source and store in a string variable to process further.

Is anyone has done this before? Please help me.

What I have tried:

Tried the example of it but not get the exact solution.
Posted
Updated 30-Jan-17 22:32pm

1 solution

Have never tried doing so but found some suggestion which may help.
C#
webView.EvaluateScript(@"document.getElementsByTagName ('html')[0].innerHTML").ToString();

There is also a GetSourceAsync() method which may help.
CefSharp/IWebBrowser.cs at cefsharp/41 · cefsharp/CefSharp · GitHub[^]

Hope, it helps :)
 
Share this answer
 
Comments
Ajay_Saini 1-Feb-17 0:52am    
Hi,
Thanks for your reply.
It seems that it can help me but i am struggling to use it. Do you have some working solution?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900