Martin Rezyne
Martin Rezyne

Reputation: 445

C# Get text which replaces text from span tags of an HTML code

I have to do a console application in C# which reads some text from specific webpages. Now I have some problems because I dont know how to read text between tags. To begin with, I am downloading the html code from the webpage using WebClient object.

WebClient client = new WebClient();
String htmlCode = client.DownloadString(link);

In htmlCode string, between tags I have an image which is a gif of an loading bar.

<span id="bitrate_0"><img src="http://webpage.net/images/loading.gif" /></span>

If I go to that website from a browser and check that part or if I use Inspect Element feature (which shows me html code) on that part of the webpage, I have a long text (which I need to get). In addition, in the browser, if I choose to View source, there still are those tags.

I need to get the text which replaces the gif image. How can I do that?

Thank you.

Upvotes: 0

Views: 754

Answers (1)

Noctis
Noctis

Reputation: 11763

Just so you'll have it handy:

Having said the above, if you put in the time to go through the above material, you shouldn't have a problem of finding the span and playing around with it.

Good luck :)

Upvotes: 1

Related Questions