private void SetCookies(ReqParametres req) { CookieContainer cookieContainer = new CookieContainer(); cookieContainer.Add(new Uri("https://ic-ua.intercars.eu/"), new Cookie("khkod", "U" + _khcode)); cookieContainer.Add(new Uri("https://ic-ua.intercars.eu/"), new Cookie("lang", "UA")); cookieContainer.Add(new Uri("https://ic-ua.intercars.eu/"), new Cookie("kraj", "UA")); cookieContainer.Add(new Uri("https://ic-ua.intercars.eu/"), new Cookie("PHPSESSID", "elo485mp69q42ejdgjssd23ev4")); req.SetCookie(cookieContainer); }
private void CookieSet() { LinkParser linkParser; do { ReqParametres reqParametres = new ReqParametres("https://www.zillow.com/"); reqParametres.SetUserAgent(Useragents.GetNewUseragent()); //reqParametres.SetProxy(); if (SavedCookies != null) { reqParametres.SetCookie(SavedCookies); } linkParser = new LinkParser(reqParametres.Request); SavedCookies = linkParser.Cookies; } while (isCaptcha(linkParser.Data)); }
private void SetKhcodeProcess(int count) { Thread thread = new Thread( (() => { for (int i = count; i < count + 1000; i++) { _count++; if (Khcode != "") { break; } ReqParametres req = new ReqParametres( "https://ic-ua.intercars.eu/dynamic/ickatalogweb/ws_zamienniki.php?popup=T&firgru=|UJ5|UJ8|UR1|UR3&towkod=BC421D&zakres=all"); req.SetUserAgent( "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.34 Safari/537.36"); CookieContainer cookieContainer = new CookieContainer(); cookieContainer.Add( new Uri("https://ic-ua.intercars.eu/"), new Cookie("khkod", "U" + i)); cookieContainer.Add(new Uri("https://ic-ua.intercars.eu/"), new Cookie("lang", "UA")); cookieContainer.Add(new Uri("https://ic-ua.intercars.eu/"), new Cookie("kraj", "UA")); cookieContainer.Add( new Uri("https://ic-ua.intercars.eu/"), new Cookie("PHPSESSID", "elo485mp69q42ejdgjssd23ev4")); req.SetCookie(cookieContainer); LinkParser link = new LinkParser(req.Request); List <string> zaminniki = link.Data.ParsRegex(" <b>(.*?)<", 1); if (zaminniki.Count > 0) { Khcode = i.ToString(); break; } } })); thread.IsBackground = true; thread.Start(); }
private bool IsValidCode(string code) { ReqParametres req = new ReqParametres("https://ic-ua.intercars.eu/dynamic/ickatalogweb/ws_zamienniki.php?popup=T&firgru=|UJ5|UJ8|UR1|UR3&towkod=BC421D&zakres=all"); req.SetUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.34 Safari/537.36"); CookieContainer cookieContainer = new CookieContainer(); cookieContainer.Add(new Uri("https://ic-ua.intercars.eu/"), new Cookie("khkod", "U" + code)); cookieContainer.Add(new Uri("https://ic-ua.intercars.eu/"), new Cookie("lang", "UA")); cookieContainer.Add(new Uri("https://ic-ua.intercars.eu/"), new Cookie("kraj", "UA")); cookieContainer.Add(new Uri("https://ic-ua.intercars.eu/"), new Cookie("PHPSESSID", "elo485mp69q42ejdgjssd23ev4")); req.SetCookie(cookieContainer); LinkParser link = new LinkParser(req.Request); List <string> zaminniki = link.Data.ParsRegex(" <b>(.*?)<", 1); if (zaminniki.Count > 0) { return(true); } else { return(false); } }