Пример #1
0
        public string Data(string link)
        {
            CrawlerUtils cu          = new CrawlerUtils(link);
            var          rawDataList = cu.CrawlNodes("//*[contains(@class,'detail-title')]");

            return(rawDataList.FirstOrDefault().InnerHtml);
        }
Пример #2
0
        public List <UserContent> GetUserContent()
        {
            List <UserContent> list = new List <UserContent>();

            foreach (var item in CrawlURLs)
            {
                try
                {   //İsim ve telefon no yazmayanlar için
                    CrawlerUtils  crawler          = new CrawlerUtils("https://www.sahibinden.com/" + item);
                    List <string> Plist            = new List <string>();
                    var           data             = crawler.CrawlNodes("//*[contains(@class,'username-info-area')]/h5");
                    string        UserNameInfoArea = data.FirstOrDefault().InnerHtml;
                    foreach (var pitem in crawler.CrawlNodes("//*[contains(@class,'pretty-phone-part')]"))
                    {
                        Plist.Add(pitem.InnerHtml);
                    }
                    list.Add(new UserContent()
                    {
                        UserNameInfoArea = UserNameInfoArea,
                        UserContactInfo  = Plist
                    });
                }
                catch (Exception)
                {
                }
            }

            return(list);
        }