1

I'm wanting to get source code of a web page based on Angular (so cannot use HttpClient or WebClient, page source completes after running JS), tried to use CefSharp (v.100) but cannot find a way to get page source. I found EvaluateScriptAsync and webBrowser.Document but no one works in version 100.

[Update] I need to get a resource link from source, or even if I can do it via RequestHandle to get a resource link which requested after Angular rendering.

Kazem Ma
  • 31
  • 7
  • Hi! Give an example of the code that you got. And maybe it will help https://stackoverflow.com/questions/35890355/get-html-source-code-from-cefsharp-web-browser – QuiShimo May 03 '22 at 17:04

1 Answers1

0

Use GetSourceAsync to get the source.

//add using CefSharp;
var source = await chromiumWebBrowser.GetSourceAsync();
amaitland
  • 4,073
  • 3
  • 25
  • 63
  • 1
    Tried that but it doesn't show updated source (after running JS scripts).I want to get source code after running Angular. – Kazem Ma May 04 '22 at 12:40
  • You will need to provide a code example, edit your original question. Most common cause is you aren't waiting for the changes you've made to render. – amaitland May 04 '22 at 19:11