Esempio n. 1
0
 private static void digikala_SitemapToObject(string path)
 {
     //string path = @"C:\Digikala\100125842.xml";
     using (var sitemap = new SitemapHelper())
     {
         Urlset list  = sitemap.SitemapToObject(path);
         var    _test = list.urlset.ToList();
         Console.WriteLine("Sitemap Count: " + _test.Count());
     }
 }
Esempio n. 2
0
        private static void digikala_LoadSitemap()
        {
            string        dirPath           = @"C:\Digikala\xml\clean";
            DirectoryInfo directorySelected = new DirectoryInfo(dirPath);
            string        file1             = string.Empty;

            FileInfo[]    fileInfos = directorySelected.GetFiles("*.xml");
            List <B5_Url> dkps      = new List <B5_Url>();

            for (int i = 0; i < fileInfos.Length; i++)
            {
                using (var sitemap = new SitemapHelper())
                {
                    dkps.AddRange(sitemap.SitemapToObject(fileInfos[i].ToString()).urlset.ToList());
                }
            }
            using (IWebsiteCrawler digikala = new DigikalaHelper())
            {
                digikala.AddBasePages(dkps);
            }
            int sss = 5;
        }