Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
我在 GooglePlex 上搜索了 HTML,发现 Html Agility Pack 我不知道是否是为了这个或不,我现在正在下载尝试一下。
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 格式是否正确,您可以将其转换为
XmlDocument:
然后您就可以轻松地操作它,而无需
WebBrowser
实例。 至于线程,我对XmlDocument
的实现了解不够,无法知道该部分的答案。如果文档的格式不正确,您可以使用 NTidy (HTML Tidy 的 .NET 包装器)首先使其成形; 我曾经为一个项目做过一次这样的事情,这真的不算太糟糕。
Depending on what you are trying to do (maybe you can give us more details?) and depending on whether or not the HTML is well-formed, you could convert this to an
XmlDocument
:Then you could manipulate it easily, without the
WebBrowser
instance. As for threads, I don't know enough about the implementation ofXmlDocument
to know the answer to that part.If the document isn't in proper form, you could use NTidy (.NET wrapper for HTML Tidy) to get it in shape first; I had to do this very thing for a project once and it really wasn't too bad.
JasonBunting 已经发布了此内容,但使用 .net 包装器围绕 HTML tidy 并将其加载到 XmlDocument 中确实有效。
我之前使用过这个.net包装器:
http://www.codeproject.com/KB/ cs/ZetaHtmlTidy.aspx
并像这样实现它:
抱歉,如果被认为是转发:)
JasonBunting already posted this, but it really works to use a .net wrapper around HTML tidy and load it up in an XmlDocument.
I have used this .net wrapper before :
http://www.codeproject.com/KB/cs/ZetaHtmlTidy.aspx
And implemented it somewhat like this:
Sorry if considered a repost :)
这是一个老问题了。 现在有:
This is an old question. Now there are: