Closed flanderboy closed 1 year ago
Hello @otsch, I receve this error
PHP Fatal error: Uncaught Error: Class "Microseconds" not found in .../crawler.php:65
for this code reader on documentations
public function loader(UserAgentInterface $userAgent, LoggerInterface $logger): LoaderInterface { $cache = new FileCache(__DIR__ . '/cachedir'); $cache->ttl(new DateInterval('P2D')); $cache->useCompression(); $loader = new HttpLoader($userAgent, logger: $logger); $loader->throttle() ->waitBetween( Microseconds::fromSeconds(1.0), Microseconds::fromSeconds(2.0) ); $loader->setCache($cache); return $loader; }
Ah, sorry, the import statement for the Microseconds class is missing in the code example in the docs. I'll add it. Just add this in your code:
Microseconds
use Crwlr\Crawler\Loader\Http\Politeness\TimingUnits\Microseconds;
Hello @otsch, I receve this error
PHP Fatal error: Uncaught Error: Class "Microseconds" not found in .../crawler.php:65
for this code reader on documentations