0
我在我的WinForm項目中使用了CefSharp v55.0。頁面加載後,我想從中獲取HTML代碼。而對於我使用這個:從Cefsharp瀏覽器獲取HTML
private void WebBrowserFrameLoadEnded(object sender, FrameLoadEndEventArgs e)
{
if (e.Frame.IsMain)
{
test.ViewSource();
test.GetSourceAsync().ContinueWith(code =>
{
var html = code.Result;
});
}
}
和交叉檢驗,我也呼籲test.ViewSource()方法,一看就知道,如果GetSourceAsync方法越來越整個代碼或沒有。
不幸的是,代碼是不同的。 ViewSource獲取整個代碼,但GetSourceAsync沒有通過頁面中生成的JavaScript獲取代碼。
Plase引導我一種獲得像ViewSource這樣的頁面源代碼的方法,或者告訴我如何捕獲這個ViewSource方法的臨時文件。
乾杯。
見https://github.com/cefsharp/CefSharp/issues/1864 – amaitland