Search code examples
vb.netreflectionawesomium

Awesomium - How to get HTML code of a web page?


This is my best attempt, but it doesn't seem to retrieve the body of html (i get only the head part).

Dim page_source As String = DirectCast((From k In DirectCast(Reflection.Type _
            Info.GetTypeFromHandle(WebControl2.GetType.TypeHandle),  _
            Reflection.TypeInfo).DeclaredMembers Where k.Name = "qnTkKOiivD"). _
            First, FieldInfo).GetValue(WebControl1)

"qnTkKOiivD" is the name of the private property that holds what seems to be the pagesource in the Awesomium WebControl.


Solution

  • There is even an easier way than using javascript. There should be a property called HTML on your WebView that yields the html.

    EDIT:

    There apparently has been a bug causing the property to only return the <head> tag. This bug is resolved in the latest updated version (1.7.5.0).