1

I wanna get table from this url but content loads by javascript. I download HTML string like this

WebClient wc = new WebClient();
var html = wc.DownloadString("https://www.bloomberg.com/markets/currencies");

how can i get javascript loaded content??

Amir Tvs
  • 85
  • 1
  • 3
  • 12
  • 1
    Do you mean to wait till javascript run and generate the table then you read it? – Amr Elgarhy Jul 03 '18 at 11:56
  • 1
    Possible duplicate of [c# download html string after page loading is finished](https://stackoverflow.com/questions/35365068/c-sharp-download-html-string-after-page-loading-is-finished) – mjwills Jul 03 '18 at 11:59
  • @AmrElgarhy not exactly but that would be great! – Amir Tvs Jul 03 '18 at 12:05

1 Answers1

1

WebClient and DownloadString will just download the content of the page as string, to be able to run the JavaScript code on this page, you will need an object which understand DOM and can run JavaScript, this will be a browser.

Some more information about this subject:
Running Scripts in HtmlAgilityPack
Load a DOM and Execute javascript, server side, with .Net

Amr Elgarhy
  • 66,568
  • 69
  • 184
  • 301