-1

I have this from html page source

<h5 class="icn-venue"><a href="/venues/mmxchi-tavernita-venue" class="pin-red place" data-lat="41.8938" data-lon="-87.633" rel="map">Tavernita</a></h5>

There are say 10 values like this between these tags on the page source. I want to extract value between "h5" tags. Class="icn-venue" remains same for all values. I tried splitting the tag and then storing but the code doesnt seem to work.

user1733271
  • 117
  • 1
  • 2
  • 8

2 Answers2

2

You can do it like this using htmlAgilityPack:

HtmlDocument doc = new HtmlDocument();
doc.Load(yourStream);

List<string> lst=doc.DocumentNode.SelectNodes("//h5[class='icn-venue']")
                    .Select(x=>x.InnerHtml)
                    .ToList();
Germstorm
  • 9,709
  • 14
  • 67
  • 83
Anirudha
  • 32,393
  • 7
  • 68
  • 89
1

HTML Agility Pack is a great tool for manipulating and working with HTML: http://htmlagilitypack.codeplex.com/

It could at least make grabbing the values you need and doing the replaces a little easier.

Contains links to using the HTML Agility Pack: How to use HTML Agility pack

Community
  • 1
  • 1
Ravindra Bagale
  • 17,226
  • 9
  • 43
  • 70