Getting the HTML source through the WebBrowser control in C#

前端 未结 5 694
一生所求
一生所求 2021-01-02 02:40

I tried to get HTML Source in the following way:

webBrowser1.Document.Body.OuterHtml;

but it does not work. For example, if the original HT

5条回答
  •  天涯浪人
    2021-01-02 03:08

    Thank you all. My final solution is: first,using body.outlineHtml to get html source. because body.outlineHtml may miss end-tag for

  • and , so the second step is using tidy to repair the HTML source. after these, we can get the HTML source without error

提交回复
热议问题