第三方
SgmlReaderDll  

/// <summary>

        /// 把html转成XML
        /// </summary>
        /// <param name="html"></param>
        /// <returns></returns>
        private static XElement Html2XML(string html)
        {
            Sgml.SgmlReader sgmlReader = new Sgml.SgmlReader();

            sgmlReader.DocType = "HTML";
            sgmlReader.WhitespaceHandling = WhitespaceHandling.All;
            sgmlReader.CaseFolding = Sgml.CaseFolding.ToLower;
            sgmlReader.InputStream = new StringReader(html);
            return XElement.Load(sgmlReader);
        }           


相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2022-12-23
猜你喜欢
  • 2021-08-30
  • 2022-12-23
  • 2021-09-26
  • 2022-03-06
  • 2021-09-29
  • 2021-06-21
  • 2022-12-23
相关资源
相似解决方案