0

I've been trying to get this piece of code to run for a while. Encountered countless resources and I'm afraid I'm running out of things to try. I've revised this code many times and the syntax looks correct to me, but I'm just a newbie to HtmlAgilityPack.

I'm trying to get the current price of Bitcoin from https://www.gdax.com/trade/BTC-USD . I've done this before on other sites from harvesting html features, but I'm stumped when it comes to elements using HAP:

var webGet = new HtmlWeb();
var doc = webGet.Load("https://www.gdax.com/trade/BTC-USD");

var ourNone = doc.DocumentNode.SelectSingleNode("//span[@class='MarketInfo_market-num_1lAXs']");

    if (ourNone != null)
    {
        label1.Text = ourNone.InnerHtml;
    }
Alexei Levenkov
  • 98,904
  • 14
  • 127
  • 179
Robby
  • 23
  • 3
  • the view source of url you that you have mentioned does not includes class "MarketInfo_market-num_1lAXs" anywhere in html. – Murtaza Tahir Ali Nov 23 '17 at 04:49
  • Its in Javascript. I'm not really sure how to use HAP to get data from Javascript or if I need something else. It seems to be a really gray area. – Robby Nov 23 '17 at 04:58
  • 1
    There are tons of questions about scraping dynamic html - https://www.bing.com/search?q=c%23+scrape+dynamic+html – Alexei Levenkov Nov 23 '17 at 06:23

0 Answers0