public static CreateDocument ( System.Stream html ) : |
||
html | System.Stream | /// An open Stream /// |
리턴 |
/// <summary> /// Creates a new DOM from an HTML file. /// </summary> /// /// <param name="htmlFile"> /// The full path to the file /// </param> /// /// <returns> /// The new document from file. /// </returns> public static CQ CreateDocumentFromFile(string htmlFile) { using (Stream strm = Support2.GetFileStream(htmlFile)) { return(CQ.CreateDocument(strm)); } }
/// <summary> /// Creates a new DOM from an HTML file. /// </summary> /// /// <param name="url"> /// The URL of the remote server. /// </param> /// <param name="options"> /// The options to use when creating the reqest. /// </param> /// /// <returns> /// A CQ object composed from the HTML response from the server. /// </returns> public static CQ CreateFromUrl(string url, ServerConfig options = null) { CsqWebRequest request = new CsqWebRequest(url); ServerConfig.Apply(options, request); request.Get(); return(CQ.CreateDocument(request.Html)); }
/// <summary> /// Creates a new DOM from an HTML file. /// </summary> /// /// <param name="url"> /// The URL of the remote server. /// </param> /// <param name="options"> /// The options to use when creating the reqest. /// </param> /// /// <returns> /// A CQ object composed from the HTML response from the server. /// </returns> public static CQ CreateFromUrl(string url, ServerConfig options = null) { CsqWebRequest request = new CsqWebRequest(url); request.Options = options; var httpRequest = request.GetWebRequest(); var response = httpRequest.GetResponse(); var responseStream = response.GetResponseStream(); var encoding = CsqWebRequest.GetEncoding(response); return(CQ.CreateDocument(responseStream, encoding)); }