Get the final generated html source using c# or vb.net

前端 未结 3 1581
野的像风
野的像风 2020-11-27 22:25

using VB.net or c#, How do I get the generated HTML source?

To get the html source of a page I can use this below but this wont get the generated source, it won\'t c

3条回答
  •  南方客
    南方客 (楼主)
    2020-11-27 23:02

    You can use WebKit.NET

    Look here for official tutorials

    This can not only grab the source, but also process javascript through the pageload event.

    webKitBrowser1.Navigate(MyURL)
    

    Then, handle the DocumentCompleted event, and:

    private documentContent = webKitBrowser1.DocumentText
    

    Edit - This might be the better open source WebKit option: http://code.google.com/p/open-webkit-sharp/

提交回复
热议问题