I'm trying to call a site via its url to build a webscraper, but when i try to grab the items from the awaited url my application stops and brings up this message:
blablah.exe (process 1512) exited with code 0.
To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stop
I dont think this is a code issue, perhaps something with my visual studio debugger? for the life of me can't see what it is.
This is a .net core command line app
Some code just in-case
static void Main(string[] args)
{
GetHtmlAsync();
}
private static async void GetHtmlAsync()
{
var url = "https://blahblah.com";
var client = new HttpClient();
var html = await client.GetStringAsync(url);
var htmlDoc = new HtmlDocument();
htmlDoc.LoadHtml(html);
var newsList = htmlDoc.DocumentNode.Descendants("table")
.Where(node => node.GetAttributeValue("class","")
.Equals("itemList")).ToList();
Console.WriteLine(newsList);
Console.Read();
}
}
when debugging it never even reaches:
var htmlDoc = new HtmlDocument();
any ideas?