Update HttpClientManager.cs
This commit is contained in:
parent
aaffd43168
commit
be28b0db3e
1 changed files with 8 additions and 3 deletions
|
@ -31,7 +31,10 @@ internal static class HttpClientManager
|
||||||
document.LoadHtml(reader.ReadToEnd());
|
document.LoadHtml(reader.ReadToEnd());
|
||||||
return document;
|
return document;
|
||||||
}
|
}
|
||||||
catch { return null; }
|
catch
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static async Task<HtmlNodeCollection> GetDocumentNodes(string url, string xpath) => (await Get(url))?.DocumentNode?.SelectNodes(xpath);
|
internal static async Task<HtmlNodeCollection> GetDocumentNodes(string url, string xpath) => (await Get(url))?.DocumentNode?.SelectNodes(xpath);
|
||||||
|
@ -42,8 +45,10 @@ internal static class HttpClientManager
|
||||||
{
|
{
|
||||||
return new Bitmap(await HttpClient.GetStreamAsync(url));
|
return new Bitmap(await HttpClient.GetStreamAsync(url));
|
||||||
}
|
}
|
||||||
catch { }
|
catch
|
||||||
return null;
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void Dispose() => HttpClient.Dispose();
|
internal static void Dispose() => HttpClient.Dispose();
|
||||||
|
|
Loading…
Reference in a new issue