我如何可以操纵的HTML在C#中的字符串的DOM? [英] How can I manipulate the DOM from a string of HTML in C#?
本文介绍了我如何可以操纵的HTML在C#中的字符串的DOM?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有关的那一刻,我发现能够从包含HTML字符串操作DOM最好的办法是:
For the moment the best way that I have found to be able to manipulate DOM from a string that contain HTML is:
WebBrowser webControl = new WebBrowser();
webControl.DocumentText = html;
HtmlDocument doc = webControl.Document;
有两个问题:
- 需要
web浏览器
的对象! - 这不能与多个线程使用;我需要的东西,将工作在不同的线程(而不是主线程)。
- Requires the
WebBrowser
object! - This can't be used with multiple threads; I need something that would work on different thread (other than the main thread).
任何想法?
推荐答案
我做了搜索,Google总部对HTML,我发现的Html敏捷包,我不知道这是否是该与否,我下载它现在给一个尝试。
I did a search to GooglePlex for HTML and I found Html Agility Pack I do not know if it's for that or not, I am downloading it right now to give a try.
这篇关于我如何可以操纵的HTML在C#中的字符串的DOM?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文