0

First off: This is my first time trying to connect with a Webpage so if my questions are dumb but that's just how i feel now so it should be right. :D

I thought of just trying to read out a Artist/song from a Webradio as a slow start so i can use this to learn a bit about it all.

I Chose http://www.planetradio.de/ as Radio source. Note that i don't want the song played as well. Just the current song displayed in a string....but all i find as Code are suggestions how to read the songname when the song is played as well...

If someone could give me a hint or a bit of help to get me started i'd really appreciate it. :)

Thanks in advance to everyone

Thanos Markou
  • 2,587
  • 3
  • 25
  • 32
scitch
  • 55
  • 1
  • 8

1 Answers1

1

You can use the WebClient class. You can see some examples here.

Basically what you need to do is download the HTML of the page in a string with the WebClient.DownloadString Method. Once you have the HTML string, it will be easy to get the tags you want.

There are different approach to obtain what you are looking for, but I think the simplest is this one.

Community
  • 1
  • 1
user449689
  • 3,142
  • 4
  • 19
  • 37
  • 1
    http://www.nuget.org/packages/HtmlAgilityPack can also be useful for parsing the html and scraping the text that you want – mortb Nov 19 '15 at 10:50
  • @user449689 thanks that helped me a lot! :) But i have another question: If i implement the Code trying to get the html i get the whole "trackfinder" on the Website mentioned above. But i really just Need this part: "Wild And Free " Is there a way to just get this part in the html? – scitch Nov 19 '15 at 11:39
  • @scitch as mortb wrote in his comment, you can use HtmlAgilityPack, it's a package that can help you read the DOM using XPATH. You can find an example and some links to other examples here: http://stackoverflow.com/questions/846994/how-to-use-html-agility-pack I think that reading some documentation you will have no problem getting the tag you are looking for ;) – user449689 Nov 19 '15 at 12:38