public string GetHtml(string URL, ref Chilkat.Http http) { string response = string.Empty; ChangeProxy(); if (!http.UnlockComponent("THEBACHttp_b3C9o9QvZQ06")) { } ///Save Cookies... http.CookieDir = "memory"; //http.CookieDir = Application.StartupPath + "\\cookies"; http.SendCookies = true; http.SaveCookies = true; http.SetRequestHeader("Accept-Encoding", "gzip,deflate"); http.SetRequestHeader("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7"); http.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.24) Gecko/20111103 Firefox/3.6.24"); http.SetRequestHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); //http.SetRequestHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); //http.SetRequestHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); http.SetRequestHeader("Connection", "keep-alive"); http.AllowGzip = true; response = http.QuickGetStr(URL); return(response); }
public string GetHtmlProxy(string URL, string proxyAddress, string proxyPort, string proxyUsername, string proxyPassword, ref Chilkat.Http http) { string response = string.Empty; this.proxyAddress = proxyAddress; this.proxyPort = proxyPort; this.proxyUsername = proxyUsername; this.proxyPassword = proxyPassword; ChangeProxy(); if (!http.UnlockComponent("THEBACHttp_b3C9o9QvZQ06")) { } ///Save Cookies... http.CookieDir = "memory"; http.SendCookies = true; http.SaveCookies = true; http.SetRequestHeader("Accept-Encoding", "gzip,deflate"); http.SetRequestHeader("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7"); http.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.24) Gecko/20111103 Firefox/3.6.24"); http.SetRequestHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); response = http.QuickGetStr(URL); return(response); }
public ChilkatHttpHelpr() { if (!http.UnlockComponent("THEBACHttp_b3C9o9QvZQ06")) { } ///Save Cookies... http.CookieDir = "memory"; http.SendCookies = true; http.SaveCookies = true; http.SetRequestHeader("Accept-Encoding", "gzip,deflate"); http.SetRequestHeader("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7"); http.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; rv:18.0) Gecko/20100101 Firefox/18.0"); http.SetRequestHeader("Accept", "application/json,text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8, */*"); http.SetRequestHeader("Connection", "keep-alive"); http.AllowGzip = true; }
public static string GetHtml(string URL) { string response = string.Empty; //ChangeProxy(); if (!http.UnlockComponent("THEBACHttp_b3C9o9QvZQ06")) { } ///Save Cookies... http.CookieDir = "memory"; //http.CookieDir = Application.StartupPath + "\\cookies"; http.SendCookies = true; http.SaveCookies = true; http.SetRequestHeader("Accept-Encoding", "gzip,deflate"); http.SetRequestHeader("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7"); http.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.107 Safari/537.36"); http.SetRequestHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); //http.SetRequestHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); //http.SetRequestHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); http.SetRequestHeader("Connection", "keep-alive"); http.AllowGzip = true; response = http.QuickGetStr(URL); if (string.IsNullOrEmpty(response)) { response = http.QuickGetStr(URL); } if (string.IsNullOrEmpty(response)) { response = http.QuickGetStr(URL); } return(response); }
public void SetCookie(string rawCookieStr, ref Chilkat.Http http) { http.SetRequestHeader("Cookie", rawCookieStr); }
public ChilkatHttpHelpr() { //ServicePointManager.ServerCertificateValidationCallback = delegate { return true; }; //Chilkat.Cert cert = http.GetServerSslCert("facebook.com", 443); //http.SetSslClientCert(cert); if (!http.UnlockComponent("THEBACHttp_b3C9o9QvZQ06")) { return; } ///Save Cookies... http.CookieDir = "memory"; http.SendCookies = true; http.SaveCookies = true; http.SetRequestHeader("Accept-Encoding", "gzip,deflate"); http.SetRequestHeader("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7"); http.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.24) Gecko/20111103 Firefox/3.6.24"); http.SetRequestHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); http.SetRequestHeader("Connection", "keep-alive"); http.AllowGzip = true; }