/// <summary> /// Builds a new HTML Document by asynchronously requesting the given URL. /// </summary> /// <param name="configuration">Options to use for the document generation.</param> /// <param name="url">The URL which points to the address containing the source code.</param> /// <returns>The task that constructs the HTML document.</returns> public static Task <IDocument> ParseHtmlAsync(this IConfiguration configuration, Uri url) { return(DocumentBuilder.HtmlAsync(url, configuration)); }
/// <summary> /// Uses the URL to download the content asynchronously, parse it as HTML and returning /// a new HTMLDocument with the DOM representation. /// </summary> /// <param name="uri">The source of the HTML content.</param> /// <param name="cancel">The cancellation token for aborting the download.</param> /// <param name="configuration">[Optional] Custom options to use for the document generation.</param> /// <returns>The HTML document.</returns> public static Task <IDocument> GetHtmlAsync(this Uri uri, CancellationToken cancel, IConfiguration configuration = null) { return(DocumentBuilder.HtmlAsync(uri, cancel, configuration)); }
/// <summary> /// Builds a new HTML Document asynchronously with the given (network) stream. /// </summary> /// <param name="configuration">Options to use for the document generation.</param> /// <param name="content">The stream of chars to use as source code.</param> /// <param name="url">[Optional] The base URL of the document.</param> /// <returns>The task to construct the HTML document.</returns> public static Task <IDocument> ParseHtmlAsync(this IConfiguration configuration, Stream content, String url = null) { return(DocumentBuilder.HtmlAsync(content, configuration, url)); }