예제 #1
0
 public override void Handle(ref Page page, ISpider spider)
 {
     if (DateTime.Now > NextTime)
     {
         CookieInjector?.Inject(spider);
         NextTime = DateTime.Now.AddSeconds(DueTime);
     }
 }
예제 #2
0
 public override void Handle(ref Page page, ISpider spider)
 {
     if (page != null && !string.IsNullOrEmpty(page.Content) && page.Content.Contains(Content))
     {
         CookieInjector?.Inject(spider);
     }
     throw new SpiderException($"Content downloaded contains string: {Content}.");
 }
예제 #3
0
 public override bool Handle(Page page, ISpider spider)
 {
     if (!string.IsNullOrEmpty(page.Content) && page.Content.Contains(Content))
     {
         CookieInjector?.Inject(spider);
     }
     throw new DownloadException($"Content downloaded contains string: {Content}.");
 }
예제 #4
0
        public override bool Handle(Page page, ISpider spider)
        {
            if (DateTime.Now > Next)
            {
                CookieInjector?.Inject(spider);
                Next = DateTime.Now.AddSeconds(Interval);
            }

            return(true);
        }