Beispiel #1
0
        public void Start()
        {
            Console.WriteLine(resultDate);
            browserSession = new BrowserSession();
            var cookies = new CookieCollection();
            browserSession.Cookies = cookies;
            ids = new List<int>();

            for (var i = 1; i <= pages; i++)
            {
                if (breakPoint == 1)
                {
                    break;
                }
                Console.WriteLine("-------------PAGE " + i + "-------------");
                var url = i == 1
                    ? "http://alonhadat.com.vn/nha-dat/can-ban.html"
                    : "http://alonhadat.com.vn/nha-dat/can-ban/trang--" + i + ".html";

                Count(url);
                Console.WriteLine(alonhadatReport.Debug);

            }

            browserSession = new BrowserSession();
            cookies = new CookieCollection();
            browserSession.Cookies = cookies;
            breakPoint = 0;
            for (var i = 1; i <= pages; i++)
            {
                if (breakPoint == 1)
                {
                    break;
                }
                Console.WriteLine("-------------PAGE " + i + "-------------");
                var url = i == 1
                    ? "http://alonhadat.com.vn/nha-dat/cho-thue.html"
                    : "http://alonhadat.com.vn/nha-dat/cho-thue/trang--" + i + ".html";

                Count(url);
                Console.WriteLine(alonhadatReport.Debug);

            }

            var repo = new Repository<AlonhadatReport>("alonhadatreports");
            repo.Insert(alonhadatReport);

            Console.WriteLine("***************TOTAL: " + alonhadatReport.Count);
        }
Beispiel #2
0
        public void Start()
        {
            browserSession = new BrowserSession();
            var cookies = new CookieCollection();
            //cookies.Add(new Cookie("psortfilter", "0$all$/nha-dat-ban") { Domain = "batdongsan.com.vn" });
            browserSession.Cookies = cookies;

            ids = new List<int>();
            var pages = CountPages("http://batdongsan.com.vn/nha-dat-ban");
            for (var i = 1; i <= pages; i++)
            {
                Console.WriteLine("-------------PAGE " + i + "-------------");
                var url = i == 1
                    ? "http://batdongsan.com.vn/nha-dat-ban"
                    : "http://batdongsan.com.vn/nha-dat-ban/p" + i;

                var page = Count(url);
                Console.WriteLine("in page: " + page + ". " + bdsReport.Debug);

            }

            browserSession = new BrowserSession();
            cookies = new CookieCollection();
            //cookies.Add(new Cookie("psortfilter", "0$all$/nha-dat-cho-thue") { Domain = "batdongsan.com.vn" });
            browserSession.Cookies = cookies;

            pages = CountPages("http://batdongsan.com.vn/nha-dat-cho-thue");
            for (var i = 1; i <= pages; i++)
            {
                Console.WriteLine("-------------PAGE " + i + "-------------");
                var url = i == 1
                    ? "http://batdongsan.com.vn/nha-dat-cho-thue"
                    : "http://batdongsan.com.vn/nha-dat-cho-thue/p" + i;

                var page = Count(url);
                Console.WriteLine("in page: " + page + ". " + bdsReport.Debug);

            }

            var repo = new Repository<BdsReport>("bdsreports");
            repo.Insert(bdsReport);

            Console.WriteLine("***************TOTAL: " + bdsReport.Count);
        }
Beispiel #3
0
        public void Start()
        {
            ids = new List<int>();
            browserSession = new BrowserSession();
            var cookies = new CookieCollection();
            browserSession.Cookies = cookies;
            var pages = CountPages("http://cafeland.vn/nha-dat/nha-ban/");
            for (var i = 1; i <= pages; i++)
            {
                if (breakPoint == 1)
                {
                    break;
                }
                Console.WriteLine("-------------PAGE " + i + "-------------");
                var url = i == 1
                    ? "http://cafeland.vn/nha-dat/nha-ban/"
                    : "http://cafeland.vn/nha-dat/nha-ban/page-" + i + "/";

                Count(url);
                Console.WriteLine(cafelandReport.Debug);
            }

            browserSession = new BrowserSession();
            cookies = new CookieCollection();
            browserSession.Cookies = cookies;
            breakPoint = 0;
            pages = CountPages("http://cafeland.vn/nha-dat/dat-ban/");
            for (var i = 1; i <= pages; i++)
            {
                if (breakPoint == 1)
                {
                    break;
                }
                Console.WriteLine("-------------PAGE " + i + "-------------");
                var url = i == 1
                    ? "http://cafeland.vn/nha-dat/dat-ban/"
                    : "http://cafeland.vn/nha-dat/dat-ban/page-" + i + "/";

                Count(url);
                Console.WriteLine(cafelandReport.Debug);
            }

            browserSession = new BrowserSession();
            cookies = new CookieCollection();
            browserSession.Cookies = cookies;
            breakPoint = 0;
            pages = CountPages("http://cafeland.vn/nha-dat/cho-thue/");
            for (var i = 1; i <= pages; i++)
            {
                if (breakPoint == 1)
                {
                    break;
                }
                Console.WriteLine("-------------PAGE " + i + "-------------");
                var url = i == 1
                    ? "http://cafeland.vn/nha-dat/cho-thue/"
                    : "http://cafeland.vn/nha-dat/cho-thue/page-" + i + "/";

                Count(url);
                Console.WriteLine(cafelandReport.Debug);
            }

            browserSession = new BrowserSession();
            cookies = new CookieCollection();
            browserSession.Cookies = cookies;
            breakPoint = 0;
            pages = CountPages("http://cafeland.vn/nha-dat/can-thue/");
            for (var i = 1; i <= pages; i++)
            {
                if (breakPoint == 1)
                {
                    break;
                }
                Console.WriteLine("-------------PAGE " + i + "-------------");
                var url = i == 1
                    ? "http://cafeland.vn/nha-dat/can-thue/"
                    : "http://cafeland.vn/nha-dat/can-thue/page-" + i + "/";

                Count(url);
                Console.WriteLine(cafelandReport.Debug);
            }

            browserSession = new BrowserSession();
            cookies = new CookieCollection();
            browserSession.Cookies = cookies;
            breakPoint = 0;
            pages = CountPages("http://cafeland.vn/nha-dat/can-mua/");
            for (var i = 1; i <= pages; i++)
            {
                if (breakPoint == 1)
                {
                    break;
                }
                Console.WriteLine("-------------PAGE " + i + "-------------");
                var url = i == 1
                    ? "http://cafeland.vn/nha-dat/can-mua/"
                    : "http://cafeland.vn/nha-dat/can-mua/page-" + i + "/";

                Count(url);
                Console.WriteLine(cafelandReport.Debug);
            }

            var repo = new Repository<CafelandReport>("cafelandreports");
            repo.Insert(cafelandReport);

            Console.WriteLine("***************TOTAL: " + cafelandReport.Count);
        }
Beispiel #4
0
        public void Start()
        {
            ids = new List<int>();
            browserSession = new BrowserSession();
            var cookies = new CookieCollection();
            //cookies.Add(new Cookie("psortfilter", "0$all$/nha-dat-ban") { Domain = "batdongsan.com.vn" });
            browserSession.Cookies = cookies;
            Console.WriteLine("HO CHI MINH");
            for (var i = 1; i <= pages; i++)
            {
                if (breakPoint == 1)
                {
                    break;
                }
                Console.WriteLine("-------------PAGE " + i + "-------------");
                var url = i == 1
                    ? "http://muaban.net/mua-ban-nha-dat-cho-thue-ho-chi-minh-l59-c3"
                    : "http://muaban.net/mua-ban-nha-dat-cho-thue-ho-chi-minh-l59-c3/" + i;

                Count(url);
                Console.WriteLine(muabanReport.Debug);
            }

            browserSession = new BrowserSession();
            cookies = new CookieCollection();
            browserSession.Cookies = cookies;
            breakPoint = 0;
            Console.WriteLine("HA NOI");
            for (var i = 1; i <= pages; i++)
            {
                if (breakPoint == 1)
                {
                    break;
                }
                Console.WriteLine("-------------PAGE " + i + "-------------");
                var url = i == 1
                    ? "http://muaban.net/mua-ban-nha-dat-cho-thue-ha-noi-l24-c3"
                    : "http://muaban.net/mua-ban-nha-dat-cho-thue-ha-noi-l24-c3/" + i;

                Count(url);
                Console.WriteLine(muabanReport.Debug);
            }

            browserSession = new BrowserSession();
            cookies = new CookieCollection();
            browserSession.Cookies = cookies;
            breakPoint = 0;
            Console.WriteLine("HAI PHONG");
            for (var i = 1; i <= pages; i++)
            {
                if (breakPoint == 1)
                {
                    break;
                }
                Console.WriteLine("-------------PAGE " + i + "-------------");
                var url = i == 1
                    ? "http://muaban.net/mua-ban-nha-dat-cho-thue-hai-phong-l28-c3"
                    : "http://muaban.net/mua-ban-nha-dat-cho-thue-hai-phong-l28-c3/" + i;

                Count(url);
                Console.WriteLine(muabanReport.Debug);
            }

            browserSession = new BrowserSession();
            cookies = new CookieCollection();
            browserSession.Cookies = cookies;
            breakPoint = 0;
            Console.WriteLine("DA NANG");
            for (var i = 1; i <= pages; i++)
            {
                if (breakPoint == 1)
                {
                    break;
                }
                Console.WriteLine("-------------PAGE " + i + "-------------");
                var url = i == 1
                    ? "http://muaban.net/mua-ban-nha-dat-cho-thue-da-nang-l15-c3"
                    : "http://muaban.net/mua-ban-nha-dat-cho-thue-da-nang-l15-c3/" + i;

                Count(url);
                Console.WriteLine(muabanReport.Debug);
            }

            browserSession = new BrowserSession();
            cookies = new CookieCollection();
            browserSession.Cookies = cookies;
            breakPoint = 0;
            Console.WriteLine("CAN THO");
            for (var i = 1; i <= pages; i++)
            {
                if (breakPoint == 1)
                {
                    break;
                }
                Console.WriteLine("-------------PAGE " + i + "-------------");
                var url = i == 1
                    ? "http://muaban.net/mua-ban-nha-dat-cho-thue-can-tho-l13-c3"
                    : "http://muaban.net/mua-ban-nha-dat-cho-thue-can-tho-l13-c3/" + i;

                Count(url);
                Console.WriteLine(muabanReport.Debug);
            }
            var repo = new Repository<MuabanReport>("muabanreports");
            repo.Insert(muabanReport);

            Console.WriteLine("***************TOTAL: " + muabanReport.Count);
        }