I am creating a website for getting live rate from gold to euro. This is the website that I am going to use: http://www.24hgold.com/english/gold_silver_prices_charts.aspx?money=Euro
At the moment, I plan to do is to view the source of the site and search for this portion: <span id="lbGoldGramEurValue" class="number" style="font-weight:bold;"> then I can get the rate of gold in gram for euro. What is this technique called? then I can find other samples in .NET.
Is that the only way to do or any other advance and simpler way to do so?
This is called “web scraping” and is generally a bad idea. The main reason I say this is that your app is fragile to changes in the markup of a 3rd-party website. All they need to do is one of a) change the
id, b) change theclassor c) change thestyleof that element and your app goes kaput.A far better approach (although perhaps not free) is to search for a public webservice which provides the information you need. A quick search came up with:
I should also note that web scraping another site may well infringe their copyright.