Skip to content

Instantly share code, notes, and snippets.

@NVentimiglia
Created May 2, 2020 17:38
Show Gist options
  • Save NVentimiglia/95eaf1027cf81c1b3217082a5c69a257 to your computer and use it in GitHub Desktop.
Save NVentimiglia/95eaf1027cf81c1b3217082a5c69a257 to your computer and use it in GitHub Desktop.
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