GetSource returns incomplete HTML

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

GetSource returns incomplete HTML

Postby YSFKBDY » Mon Apr 17, 2017 8:35 am

Hi guys,

I am using CefSharp v55.0 in my WinForm project. After the page is loaded, I want to get HTML code from it. And for that I am using this:

Code: Select all
private void WebBrowserFrameLoadEnded(object sender, FrameLoadEndEventArgs e)
{
    if (e.Frame.IsMain)
    {
        test.ViewSource();
        test.GetSourceAsync().ContinueWith(code =>
        {
            var html = code.Result;
        });
    }
}


And for the crosscheck, I am also calling test.ViewSource() method, to see that if GetSourceAsync method is getting the whole code or not.

Unfortunetely, codes are different. ViewSource is getting the whole code, but GetSourceAsync is not getting codes by javascript generated in the page.

Plase lead me a way to get source code of the page like ViewSource, or tell me how to capture this ViewSource method's temp file.

Cheers.

PS:
- You can find two source files as attached for ViewSource and GetSource methods.
- You can use "https://goo.gl/kcJMU1" as sample as well. ViewSource includes products, but GetSource doesn't include products.
Attachments
Desktop.rar
Sample Html Outputs
(137.1 KiB) Downloaded 433 times
YSFKBDY
Newbie
 
Posts: 1
Joined: Mon Apr 17, 2017 8:29 am

Re: GetSource returns incomplete HTML

Postby Czarek » Tue Apr 18, 2017 1:35 pm

This is not support forum for CefSharp project.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: GetSource returns incomplete HTML

Postby amaitland » Tue Apr 18, 2017 3:37 pm

I've asked that a topic is raised here. There appears to be a timing issue.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1292
Joined: Wed Jan 14, 2015 2:35 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 53 guests