从字符串,而不是文件/ URL加载 [英] Loading from string instead of document/url

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

问题描述

我只是发现了关于HTML敏捷包,我试过,但偶然发现了一个问题。无法找到网络上,试图在这里任何东西。

I just found out about html agility pack and I tried it, but stumbled upon a problem. Couldnt find anything on the web so trying here.

你知道我如何从一个字符串,而不是文件/ URL加载HTML?

Do you know how I can load the html from a string instead of document/URL ?

感谢

推荐答案

您是否尝试过使用的 LoadHtml

string htmlString = 'Your html string here...';

HtmlAgilityPack.HtmlDocument htmlDocument = new HtmlAgilityPack.HtmlDocument();
htmlDocument.LoadHtml(htmlString);

// Do whatever with htmlDocument here

这篇关于从字符串,而不是文件/ URL加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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