Using the CrawlerConfig
This is optional, you can also work with the defaults.
Using the CrawlerConfig
CrawlerConfigUsing fallback
fallbackuse EasyAI\CrawlerConfig;
$crawlerConfig = new CrawlerConfig();
$crawlerConfig->fallback = true; // default: false$crawler = new Crawler($crawlerConfig); // adding the config
$html = $crawler->getHtml('https://hosono.ai/en');Using a different Client
Clientuse EasyAI\CrawlerConfig;
use Symfony\Contracts\HttpClient\HttpClientInterface;
function setupCrawler(HttpClientInterface $client) {
$crawlerConfig = new CrawlerConfig();
$crawlerConfig->client = $client; // default: GuzzleHttp
}Using errorHandlingStrategy
errorHandlingStrategyLast updated