string get_html(string url, int timeout, CookieContainer cc, ref Encoding enc, out string Rurl, string cookie, ref CookieCollection cookieColl, out CookieCollection cookieCollection)
        {
            var html = TaobaoWebHelper.GetContent(url, 8000, cc, ref enc, out Rurl, cookie, ref cookieColl, out cookieCollection);  //web.GetHtml(url, null);

            //(string url, int timeout, CookieContainer cc, ref Encoding encoding, out string Rurl, string cookie, ref CookieCollection cookiesColl, out CookieCollection cookiesCollection)

            if (!html.IsContains2("b_content"))
            {
                WebHelperNoCookieProxy web2 = new WebHelperNoCookieProxy();
                var html2 = false;
                while (html2 == false)
                {
                    //web2.ChangeIp();
                    //IP ip = web2.my_ip;
                    //  html = WeChatQueryByBus.GetContentByIP(url, 8000, cc, ip.Ip, ip.Port, ref enc, out Rurl, cookie, ref cookieColl, out cookieCollection);//web2.GetHtml(url, null, "utf-8");
                    html  = TaobaoWebHelper.GetContent(url, 8000, cc, ref enc, out Rurl, cookie, ref cookieColl, out cookieCollection); //web.GetHtml(url, null);
                    html2 = html.IsContains2("b_content");

                    if (html.Contains("没有找到内容!"))
                    {
                        return(html);
                    }

                    if (!string.IsNullOrEmpty(html) && html.Contains("您的访问过于频繁"))
                    {
                        log("您的访问过于频繁,为确认本次访问为正常用户行为,需要您协助验证。");
                        int n = new Random().Next(1000, 3000);
                        Thread.Sleep(n);
                    }
                }
            }
            return(html);
        }
Пример #2
0
        string get_Nohtml(string url, int timeout, CookieContainer cc, ref Encoding enc, out string Rurl, string cookie, ref CookieCollection cookieColl, out CookieCollection cookieCollection)
        {
            // var html = web.GetHtml(url, null);
            var html = TaobaoWebHelper.GetContent(url, 8000, cc, ref enc, out Rurl, cookie, ref cookieColl, out cookieCollection);

            if (!html.IsContains2("wx-rb wx-rb2", "wx-rbwx-rb2"))
            {
                WebHelperNoCookieProxy web2 = new WebHelperNoCookieProxy();
                var html2 = false;
                //while (html2 == false)
                //{
                //    //  web2.ChangeIp();
                //    html = web2.GetHtml(url, null, "utf-8");
                //    html2 = html.IsContains2("wx-rb wx-rb2", "wx-rbwx-rb2");
                //    if (!string.IsNullOrEmpty(html) && html.Contains("您的访问过于频繁"))
                //    {
                //        log("您的访问过于频繁,为确认本次访问为正常用户行为,需要您协助验证。");
                //        //int n = new Random().Next(1000, 3000);
                //        //Thread.Sleep(n);
                //    }

                //}
            }
            return(html);
        }
        string get_Detailehtml(string url, int timeout, CookieContainer cc, ref Encoding enc, out string Rurl, string cookie, ref CookieCollection cookieColl, out CookieCollection cookieCollection)
        {
            WebHelperNoCookieProxy web1 = new WebHelperNoCookieProxy();
            var html = TaobaoWebHelper.GetContent(url, 8000, cc, ref enc, out Rurl, cookie, ref cookieColl, out cookieCollection);

            if (!string.IsNullOrEmpty(url))
            {
                if (!html.IsContains2("profile_inner"))
                {
                    WebHelperNoCookieProxy web2 = new WebHelperNoCookieProxy();
                    var html2 = false;
                    html  = TaobaoWebHelper.GetContent(url, 8000, cc, ref enc, out Rurl, cookie, ref cookieColl, out cookieCollection); //web.GetHtml(url, null);
                    html2 = html.IsContains2("profile_inner");
                    if (!string.IsNullOrEmpty(html) && html.Contains("您的访问过于频繁"))
                    {
                        log("您的访问过于频繁,为确认本次访问为正常用户行为,需要您协助验证。");
                        int n = new Random().Next(1000, 3000);
                        Thread.Sleep(n);
                    }
                }
            }
            return(html);
        }