提取&QUOT文本;< P>" HTML标记 [英] Extract text from "<p>" HTML tag

查看:312
本文介绍了提取&QUOT文本;< P>" HTML标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个字符串:

<a href = "http://www.zigwheels.com/reviews/long-term-reviews/fiat-linea/8804-100-1/1">
  <img src="http://static.zigwheels.com/media/content/2011/Jul/fiatlinealt_1_560x420.jpg" />
</a> 
<p>
  To sum it up in a nutshell, the Fiat Linea is a spacious family car that 
  rewards you with its space and fuel efficiency, while maintaining 
  decent levels of performance as well
</p>

我只需要在&LT文本; P&GT; 标记。请帮助...我需要它在纯VB语言为vb.net Windows应用程序。

I need just the text in the <p> tag. Please help... I need it in pure vb language for a vb.net windows application.

推荐答案

您可以使用HTML敏捷包。下面是一个例子

You can use HTML Agility Pack. Here is an example

HtmlDocument htmlDoc = new HtmlDocument();
htmlDoc.LoadHtml("Get the entire string here");
var xyz = from x in htmlDoc.DocumentNode.DescendantNodes()
                     where x.Name == "p"
                     select x.InnerText;

在这样的要求,你可以得到的价值。您可以从以下链接获得更多的帮助。

In this way you can get the value as required. You can get more help from the following link.

HTTP://htmlagilitypack.$c$cplex.com/

: VB.NET

Dim htmlDoc As New HtmlDocument()
htmlDoc.LoadHtml("Get the entire string here")
Dim xyz = From x In htmlDoc.DocumentNode.DescendantNodes() Where x.Name = "p"x.InnerText

这篇关于提取&QUOT文本;&LT; P&GT;&QUOT; HTML标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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