问题
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??
回答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
来源:https://stackoverflow.com/questions/51154007/c-sharp-get-content-loaded-by-js-from-url