Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27513

VS 2010 HTML Agility Pack finding tag and inner text

$
0
0
Hey all i have the following html that i need to get text from:
Code:

<place.tag theBID="Example of text here and there" percentage="512.6">
    <... other html tags here ...>
    <longer.bid type="string">
        This is an example of the longer bid here and there.
    </longer.bid>
    <... other html tags here ...>
</place.tag>

And this is my VB.net code:
Code:

For Each listItem In doc.DocumentNode.SelectNodes("//place.tag[""longer.bid""]")
    Debug.Print(listItem.InnerText)
Next

The error i get on the ("//place.tag[""longer.bid""]") part is:

Object reference not set to an instance of an object.

I am looking to get the text This is an example of the longer bid here and there. Problem is that i cant use [@id= or even [@class= to get the value since the theBID changes for each tag in the html. This is XML wrapped into HTML it seems.

Any help would be great!

Viewing all articles
Browse latest Browse all 27513

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>