English 中文(简体)
html 案文中的脆弱包装和三角括号
原标题:html agility pack and triangular brackets in text

当我用Html Agility包装装上某些html文档时,我发现,如果在html的标子中的案文像这种薄膜一样,它不会关闭某些标签(看内H和外衣物)。

<span class= title >&nbsp;&nbsp;Launching app results in an error "Activation of http://<server name="">/TemplateBuilder/?language=1033&locale=1033 resulted in exception"</span>

产出一

<span class= title >&nbsp;&nbsp;Launching app results in an error "Activation of http://<server name="">/TemplateBuilder/?language=1033&locale=1033 resulted in exception"

Is there anything that can be done to preserve it? Because is missing on output, the whole html is not displayed.

Thank you

最佳回答

这是因为你原来的html太无效。 应当:

<span class= title >&nbsp;&nbsp;Launching app results in an error "Activation of http://&lt;server name=""&gt;/TemplateBuilder/?language=1033&locale=1033 resulted in exception"</span>

Html Agility Pack无法检测到这种类型的恶性。

问题回答

暂无回答




相关问题
Stripping MS Word Tags Using Html Agility Pack

I have a DB with some text fields pasted from MS Word, and I m having trouble to strip just the , and tags, but obviously keeping their innerText. I ve tried using the HAP but I m not going in the ...

Select all <p> s from a Node s children using HTMLAgilityPack

I ve got the following code that I m using to get a html page. Make the urls absolute and then make the links rel nofollow and open in a new window/tab. My issue is around the adding of the attributes ...

Removing tags w/ prefix using HTML Agility Pack

I m trying to access tags with prefix using HAP but the following do not work (they return nothing): HtmlAgilityPack.HtmlNodeCollection nodes = document.DocumentNode.SelectNodes("//*[name() = sc:...

Order nodes by most images?

This might sound a bit complicated, but what I want to do is find all <a>s that contain <img>s such that the images that are in the same node with the greatest number of other images are ...

Trouble Scraping Web Page With Malformed Content

I have written c# code which utilizes the HtmlAgilityPack library in order to scrape a page located at: World s Largest Urban Areas (Page 2). Unfortunately the page consists of malformed content. ...

HTML Agility Pack - Select nodes after specific node

I asked the question in a codeplex discussion but I hope to get a quicker answer here at stackoverflow. So, I use HTML Agility Pack for HTML parsing in C#. I have the following html structure: <...

Html Agility Pack ends-with does not work

I tried to use ends-with in Html Agility Pack in the following mode: //span[ends-with(@id, Label2 )] and //span[ends-with(., test )] , but it does not work. All other functions, like starts-with ...

热门标签