Exemplo n.º 1
0
 protected void OnActionChanged(CrawlerState.Action oldAction, CrawlerState.Action newAction)
 {
     if (ActionChanged != null)
     {
         ActionChanged(this, new ActionChangedEventArgs(oldAction, newAction));
     }
 }
Exemplo n.º 2
0
        public void Crawl(string rootTarget)
        {
            Exec.Start(ThreadName, () =>
            {
                Root = rootTarget;

                _processed = new HashSet <string>();

                TargetQueue.Enqueue(Root);
                string current;
                while (TargetQueue.TryDequeue(out current))
                {
                    Current       = current;
                    CurrentAction = CrawlerState.Action.Extracting;
                    ExtractTargetsFromCurrentAndEnqueue();

                    CurrentAction = CrawlerState.Action.Processing;
                    ProcessTarget(Current);
                    _processed.Add(IsCaseSensitive ? Current : Current.ToLowerInvariant());
                }
                CurrentAction = CrawlerState.Action.Idle;
            });
        }
Exemplo n.º 3
0
 public ActionChangedEventArgs(CrawlerState.Action oldAction, CrawlerState.Action newAction)
 {
     this.OldAction = oldAction;
     this.NewAction = newAction;
 }