Пример #1
0
        private async Task YaoqimanhuaCategory(SpiderLog spiderLog, IWebDriver webDriver)
        {
            var contentCreator = new ContentSpiderCreator();

            var excutor       = TaskExutor.Instance;
            var totalCountStr = webDriver.FindElement(By.CssSelector(".showpage a")).GetAttribute("innerText");

            totalCountStr = totalCountStr.Replace("共", "").Replace("页", "").Replace(":", "");

            var name     = webDriver.FindElement(By.CssSelector(".ptitle.fc1")).GetAttribute("innerText");
            var coverImg = webDriver.FindElement(By.CssSelector("#imgString img")).GetAttribute("src");
            //contentCreator.CreateCategory(name, coverImg, "日漫", "邪恶漫画", "妖气");

            var totalCount  = int.Parse(totalCountStr);
            var targetIdStr = spiderLog.TargetUrl.Split('/').Last().Replace(".html", "");

            var imgResourceTemplate = string.Join('/', coverImg.Split("/").Reverse().Skip(1).Reverse().Append("yaoqi{0}.jpg"));

            contentCreator.CreateNewCategoryAndContentAndLoadImg("全部", name, 0, imgResourceTemplate, totalCount);
            //for (int pageIndex = 1; pageIndex <= totalCount; pageIndex++)
            //{
            //    string aLink;

            //    if (pageIndex == 1)
            //        aLink = $"http://m.yaoqi520.net/shaonvmanhua/{targetIdStr}.html";
            //    else
            //        aLink = $"http://m.yaoqi520.net/shaonvmanhua/{targetIdStr}_{pageIndex}.html";
            //    await excutor.SetTaskWithParentUrl(aLink, spiderLog.ParentUrl, name, pageIndex, "YaoqimanhuaDetail");

            //}
        }
Пример #2
0
 public Dongmanzhijia()
 {
     uploderCreator = new ContentSpiderCreator();
 }
Пример #3
0
 public Manhuadaquan()
 {
     uploderCreator = new ContentSpiderCreator();
 }