以不正确的格式解析html内容C#

以不正确的格式解析html内容C#,c#,html,parsing,fizzler,C#,Html,Parsing,Fizzler,返回的html数据格式不正确,我是从Fiddler那里得到的,现在我想解析不正确的格式数据,我尝试使用Fizzler解析它,但由于格式不正确,它无法读取div标记的类或id:以下是我的html数据: 我使用Regex来切断根(resposta=)以获得html内容,但仍然无法用于解析。(Regex:resposta\s=\s“(?(.|\n)\*.*”) 我猜由于html内容中的\符号,解析器无法使用\ 我在这里引用了html返回数据的一小部分: resposta = "<div styl

返回的html数据格式不正确,我是从Fiddler那里得到的,现在我想解析不正确的格式数据,我尝试使用Fizzler解析它,但由于格式不正确,它无法读取div标记的类或id:以下是我的html数据:

我使用Regex来切断根(resposta=)以获得html内容,但仍然无法用于解析。(Regex:resposta\s=\s“(?(.|\n)\*.*”)

我猜由于html内容中的\符号,解析器无法使用\

我在这里引用了html返回数据的一小部分:

resposta = "<div style=\" margin-top:10px;width: 100%; position:relative;height:56px;\"><a href=\"\/WebsiteRoot\/v2\/?hotelinfo&ss=433&landingpage=hfofertafranca\" rel=\"nofollow\" title=\"Offre Speciale\" onClick=\"_gaq.push([\'_trackEvent\', \'Banner Promocode Booking\', \'Click\', \'Click idioma fr\',,false]);\" class=\"addlink det\"><img src=\"\/rootimages\/ofertaespecial_fr.png\" height=\"56\" width=\"891\" alt=\"Offre Speciale\"\/><\/a><\/div><div class=\"tabBoxdisp\" style=\"margin-top:10px\"><div class=\"tabtitdisp redondotop\" style=\"color:#FFF; background:#9D293F;\"><div class=\"float-left\"><h2 class=\"upcase size18\">HF F&Eacute;NIX LISBOA<\/h2> Lisboa\/Portugal<\/div><div class=\"float-right text-right\" style=\"width:350px;\"><img src=\"\/rootimages\/icons\/star_white.png\" width=\"14\" height=\"13\" \/><img src=\"\/rootimages\/icons\/star_white.png\" width=\"14\" height=\"13\" \/><img src=\"\/rootimages\/icons
resposta=”


那么,我是否可以修复html内容而无需\使其适用于html解析器?

解决方案可能非常简单,只需将数据中的“\”(反斜杠引号)替换为“”(引号),例如:

data = data.Replace("\\\"","\"");
(您可能还必须删除第一个和最后一个引号(如果存在))