finishedCrawling() public méthode

Called when the crawl has ended.
public finishedCrawling ( ) : void
Résultat void
Exemple #1
0
 /**
  * @param \Spatie\Crawler\Url|string $baseUrl
  */
 public function startCrawling($baseUrl)
 {
     if (!$baseUrl instanceof Url) {
         $baseUrl = Url::create($baseUrl);
     }
     $this->baseUrl = $baseUrl;
     $crawlUrl = CrawlUrl::create($baseUrl);
     $this->crawlQueue->add($crawlUrl);
     $this->startCrawlingQueue();
     $this->crawlObserver->finishedCrawling();
 }
Exemple #2
0
 /**
  * Start the crawling process.
  *
  * @param \Spatie\Crawler\Url|string $baseUrl
  *
  * @throws \Spatie\Crawler\Exceptions\InvalidBaseUrl
  */
 public function startCrawling($baseUrl)
 {
     if (!$baseUrl instanceof Url) {
         $baseUrl = Url::create($baseUrl);
     }
     if ($baseUrl->isRelative()) {
         throw new InvalidBaseUrl();
     }
     $this->baseUrl = $baseUrl;
     $this->crawlUrl($baseUrl);
     $this->crawlObserver->finishedCrawling();
 }