Skip to content

Instantly share code, notes, and snippets.

@kaianuar
kaianuar / CategoryHelper.php
Created August 11, 2019 07:23
Using spatie/crawler and crawl a page and retrieve all links within that page.
<?php
namespace App\Http\Crawler;
use Spatie\Crawler\CrawlObserver;
use GuzzleHttp\Exception\RequestException;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\UriInterface;
use Symfony\Component\DomCrawler\Crawler as DomCrawler;