Example #1
0
 public void Dispose()
 {
     Response.Dispose();
     ContentCollection.Clear();
     AdsCollection.Clear();
     PricesCollection.Clear();
     LocationCollection.Clear();
     PublishingTimeCollection.Clear();
     IndividualAdsUrlsCollection.Clear();
     IndividualAdsNamesCollection.Clear();
 }
Example #2
0
        public async Task <List <string> > GetTimeToPublishAd()
        {
            var htmlDocument             = new HtmlAgilityPack.HtmlDocument();
            var parseTimeToPublishAdData = new List <string>();
            await Task.Run(() =>
            {
                for (int i = 0; i < ContentCollection.Count; i++)
                {
                    htmlDocument.LoadHtml(ContentCollection[i]);
                    HtmlNodeCollection nodeAds = htmlDocument.DocumentNode.SelectNodes("//p[@class='lheight16']/small[@class='breadcrumb x-normal'][2]/span");

                    if (nodeAds != null)
                    {
                        for (var k = 0; k < nodeAds.Count; k++)
                        {
                            PublishingTimeCollection.Add(nodeAds[k].InnerText);
                            parseTimeToPublishAdData.Add(nodeAds[k].InnerText);
                        }
                    }
                }
            });

            return(parseTimeToPublishAdData);
        }