Created
May 2, 2020 17:38
-
-
Save NVentimiglia/95eaf1027cf81c1b3217082a5c69a257 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SpyService | |
{ | |
string siteUrl = "https://ssltools.forexprostools.com/technical_summary.php?pairs=166"; | |
HttpClient httpClient = new HttpClient(); | |
public async Task<string> Get() | |
{ | |
try | |
{ | |
HttpResponseMessage request = await httpClient.GetAsync(siteUrl); | |
Stream response = await request.Content.ReadAsStreamAsync(); | |
HtmlParser parser = new HtmlParser(); | |
IHtmlDocument document = parser.ParseDocument(response); | |
var eles = document.GetElementsByClassName("ftqa11bbb"); | |
if (eles == null || eles.Length == 0) | |
{ | |
return null; | |
} | |
else | |
{ | |
return eles[0].TextContent; | |
} | |
} | |
catch (Exception ex) | |
{ | |
throw; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment