阅读网页内容 [英] Read the content of a web page
本文介绍了阅读网页内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我正在用C#设计代码来下载网页的内容,但是它不应该带有html标签.
下载整个页面后如何下载或删除它.
在此先感谢.
govardhan
Hi All,
I am designing a code in C# to download the content of a webpage, but it should not have the html tags.
How can i download it or otherwise remove it after downloading the whole page.
Thanks in Advance.
govardhan
推荐答案
签出 ^ ].
有一个很好的示例,说明了如何从网站获取内容.
关于剥离HTML标记,这要复杂一些.
一种方法是使用正则表达式替换HTML标签,但是在HTML上使用正则表达式并不好,而且非常棘手.
Check out HttpWebRequest.GetResponse[^].
There is a nice example on how to get content from a web site.
About stripping out HTML tags, it is somewhat more complex to do.
One way is to use Regular Expression to replace HTML tags, but using Regular Expression on a HTML is not good and can be very tricky.
这篇关于阅读网页内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文