1.引用Microsoft.mshtml

添加net组件 Microsoft.mshtml

2. 使用命名空间

using mshtml;

3.代码

    string detailHtml="";

           HTMLDocumentClass doc = new HTMLDocumentClass();
            IHTMLDocument2 hc = doc;
            hc.write(detailHtml);
            hc.close();
            doc = (HTMLDocumentClass)hc;
            detailHtml = doc.documentElement.innerHTML;//解析后的html
            hc.close();
            doc.close();

4:js完整的代码必须在detailHtml中,否则不会解析

相关文章:

  • 2021-11-29
  • 2021-05-27
  • 2022-01-26
  • 2021-07-19
  • 2021-09-04
  • 2022-01-12
猜你喜欢
  • 2021-09-17
  • 2022-12-23
  • 2022-01-10
  • 2022-12-23
  • 2022-12-23
  • 2021-09-01
  • 2022-12-23
相关资源
相似解决方案