Пример #1
0
        public static async void SearchMails()
        {
            List <string> Urls       = new List <string>();
            string        city       = Cities.GetRandomCity();
            string        profession = Professions.GetRandomProfession();
            string        mailType   = MailTypes.GetRandomMailType();

            string q = "דרוש/ה " + profession + " ב" + city + " " + mailType;

            q = q.Replace(" ", "+");

            for (int i = 10; i > 1; i--)
            {
                string        query = string.Format("http://search.walla.co.il/?q={0}&type=text&page={1}", q, i);
                string        g     = getPageSource(query);
                List <string> urls  = GetUrls(g);
                foreach (string u in urls)
                {
                    Urls.Add(u);
                }
            }

            foreach (string u in Urls)
            {
                if (!string.IsNullOrEmpty(u))
                {
                    GetMails(u);
                }
            }
        }
Пример #2
0
        /*Description:
         */
        public void SearchMails()
        {
            List <string> urls        = null;
            string        city        = Cities.GetRandomCity();
            string        profession  = Professions.GetRandomProfession();
            string        mailType    = MailTypes.GetRandomMailType();
            string        querySearch = string.Format($"דרוש/ה+{profession}+ב{city}+{mailType}");

            for (int i = 10; i > 1; i--)
            {
                string query      = string.Format("http://search.walla.co.il/?q={0}&type=text&page={1}", querySearch, i);
                string pageSource = TextUtils.GetPageSource(query);
                urls = TextUtils.GetUrls(pageSource);
            }

            foreach (string u in urls)
            {
                if (!string.IsNullOrEmpty(u))
                {
                    GetMails(u);
                }
            }
        }