Versuchen, diese Website zu scrappen, aber nicht in der Lage, es zu tun.
Es wird eine Ausnahme mit der Meldung 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;
}
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7
versucht Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7
als Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7
aber immer noch nicht
Ein Problem wird hier Link erstellt
Der folgende Code funktioniert wie im GitHub-Link erwähnt.
HtmlAgilityPack.HtmlDocument doc = null;
string url = "your_link";
HtmlWeb web = new HtmlAgilityPack.HtmlWeb();
doc = web.Load(url);
var html = doc.DocumentNode.OuterHtml;