字符串的HTMLDocument [英] String to HtmlDocument

查看:146
本文介绍了字符串的HTMLDocument的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过使用URL获取HTML文档 WebClient.DownloadString(URL)但随后它很难找到我要找的元素含量。虽然周围的阅读,我发现的HTMLDocument ,它有一个像的getElementById 整洁的事物。我如何填充一个的HTMLDocument 返回的HTML网址

I'm fetching the html document by URL using WebClient.DownloadString(url) but then its very hard to find the element content that I'm looking for. Whilst reading around I've spotted HtmlDocument and that it has neat things like GetElementById. How can I populate an HtmlDocument with the html returned by url?

推荐答案

的HTMLDocument 类是围绕本地的包装的IHTMLDocument2 。COM接口结果
你不能简单的从一个字符串创建

The HtmlDocument class is a wrapper around the native IHtmlDocument2 COM interface.
You cannot easily create it from a string.

您应该使用的 HTML敏捷性包的。

这篇关于字符串的HTMLDocument的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆