Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Double Parse()
- {
- String html;
- Double result;
- Int32 first, last;
- using (var client = new WebClient())
- {
- html = client.DownloadString("https://www.coingecko.com/en/widget_component/ticker/ethereum/usd");
- }
- first = html.IndexOf("<span>$", StringComparison.Ordinal) + "<span>$".Length;
- last = html.IndexOf("</span>", first, StringComparison.Ordinal);
- Double.TryParse(html.Substring(first, last - first), NumberStyles.Any, new CultureInfo("en-US"), out result);
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment