Reputation: 2428
Trying to scrape this Website but unable to do it..
It throws an exception with the message has Error downloading Html
C# Code
async public static Task<HtmlDocument> GetDocument()
{
HtmlDocument doc = null;
string url = "https://www.finedininglovers.com/recipes/appetizer/vegan-dishes-white-asparagus/";
try
{
HtmlWeb web = new HtmlWeb();
doc = await web.LoadFromWebAsync(url);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.WriteLine(ex.StackTrace);
}
return doc;
}
Tried setting Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7
as the UserAgent but still not working
Upvotes: 1
Views: 488