All notable changes to spatie/crawler will be documented in this file.
- Fix SitemapUrlParser extracting no URLs from namespaced sitemaps by @witheez in #512
- @witheez made their first contribution in #512
Full Changelog: https://github.com/spatie/crawler/compare/9.4.1...9.4.2
- Fix Guzzle 8 exception handling for responses and retries by @GrahamCampbell in #510
- @GrahamCampbell made their first contribution in #510
Full Changelog: https://github.com/spatie/crawler/compare/9.4.0...9.4.1
Added support for Guzzle 8 alongside Guzzle 7.
- Skip signal handler registration when pcntl functions are disabled by @poldixd in #508
- @poldixd made their first contribution in #508
Full Changelog: https://github.com/spatie/crawler/compare/9.3.1...9.3.2
- Skip fnmatch for URLs longer than FILENAME_MAX by @mattiasgeniar in #505
Full Changelog: https://github.com/spatie/crawler/compare/9.3.0...9.3.1
- Add a shouldStopCallback hook for graceful external stops by @kissifrot in #504
Full Changelog: https://github.com/spatie/crawler/compare/9.2.1...9.3.0
- Close response body streams after processing by @freekmurze in #503
Full Changelog: https://github.com/spatie/crawler/compare/9.0.1...9.2.1
Full Changelog: https://github.com/spatie/crawler/compare/9.1.0...9.2.0
- Fixed
allow_redirectsdefault: changed fromfalseto['track_redirects' => true]so redirects are followed and the redirect history header is populated correctly - Non-parseable responses (e.g. binary files filtered by
allowedMimeTypes) now notify observers viacrawled()with an empty body instead of being silently skipped - URLs containing control characters are now detected and reported as malformed
- Dot segments (
/../,/./) in extracted URLs are now normalized per RFC 3986 - Custom client options passed to
Crawler::create()now merge with defaults instead of replacing them (passnullto remove a default) CrawlRequestFailednow wraps non-RequestExceptionerrors so observers always receive aRequestException- Removed unused classes:
Url,ResponseWithCachedBody,InvalidUrl
stream()method to opt-in to streaming HTTP responses for reduced memory usagematchWww()method to treatwww.example.comandexample.comas equivalent when usinginternalOnly()includeSubdomains()now works as a flag oninternalOnly()and composes withmatchWww()CrawlResponse::redirectHistory()andCrawlResponse::wasRedirected()for inspecting redirect chainsCrawlObserver::crawlFailed()now receives a?TransferStatisticsparameter for detecting timeoutsaddObserver()now accepts variadic arguments:addObserver($obs1, $obs2)CrawlRequestFailednow preserves the original request fromConnectException(retaining custom headers likeX-Started-At)
Major rewrite. See UPGRADING.md for a full list of breaking changes.
- Replace
UriInterfacewith plainstringURLs throughout the API - Replace
ResponseInterfacewithCrawlResponsein observer callbacks CrawlProfileis now an interface instead of an abstract classCrawlObserverCollectionno longer implementsArrayAccessorIterator- Default scheme changed from
httptohttps - JavaScript rendering is now driver-based (Browsershot moved to
suggest) UrlParserinterface redesigned to returnExtractedUrl[]instead of adding to queue directlyCrawlQueue::has()now acceptsstringinstead ofCrawlUrl|UriInterfacestart()now returns aFinishReasonenum- URL is now required in
Crawler::create()
CrawlResponseobject withstatus(),body(),dom(),header(),transferStats(), and moreCrawlProgresstracking withurlsCrawled,urlsFailed,urlsFound,urlsPendingFinishReasonenum:Completed,CrawlLimitReached,TimeLimitReached,Interrupted- Closure callbacks:
onCrawled(),onFailed(),onFinished(),onWillCrawl() foundUrls()to collect all URLs asCrawledUrlobjectsfake()for testing without HTTP requests- Scope helpers:
internalOnly(),includeSubdomains(),shouldCrawl() - Shorter method names:
depth(),concurrency(),delay(),limit(),userAgent() - Throttling:
FixedDelayThrottleandAdaptiveThrottle - Resource type extraction:
alsoExtract(),extractAll(),ResourceTypeenum - URL normalization in
ArrayCrawlQueue - Graceful shutdown via SIGINT/SIGTERM
alwaysCrawl()andneverCrawl()pattern overridesretry()for automatic retries on connection errors and 5xx responsesTransferStatisticswith typed timing accessorsCloudflareRendererfor JavaScript renderingJavaScriptRendererinterface for custom renderers- Request configuration:
basicAuth(),token(),withoutVerifying(),proxy(),cookies(),queryParameters(),middleware()
CrawlUrl::create()static factory (usenew CrawlUrl(...)instead)Spatie\Crawler\UrlclassResponseWithCachedBody(replaced byCrawlResponse)nicmart/treedependencyspatie/browsershotas a required dependency (moved tosuggest)setBrowsershot()andgetBrowsershot()methodsstartCrawling()method (usestart())setUrlParserClass()(useparseSitemaps()or pass aUrlParserdirectly)
Add Laravel 13 support
- Update nicmart/tree dependency version to ^0.10 by @robinmiau in #497
- @robinmiau made their first contribution in #497
Full Changelog: https://github.com/spatie/crawler/compare/8.4.6...8.4.7
- When fetching robots.txt, use the same User-Agent as defined by the user by @mattiasgeniar in #491
Full Changelog: https://github.com/spatie/crawler/compare/8.4.4...8.4.5
- Update issue template by @AlexVanderbist in #488
- fix(CrawlUrl): Use before initialization is now impossible by @Voltra in #490
- @Voltra made their first contribution in #490
Full Changelog: https://github.com/spatie/crawler/compare/8.4.3...8.4.4
- Do not try robots.txt when ignored by @kissifrot in #485
- @kissifrot made their first contribution in #485
Full Changelog: https://github.com/spatie/crawler/compare/8.4.2...8.4.3
- set spatie/browsershot minimal version to 5.0.5 by @grafst in #484
- @grafst made their first contribution in #484
Full Changelog: https://github.com/spatie/crawler/compare/8.4.1...8.4.2
Full Changelog: https://github.com/spatie/crawler/compare/8.4.0...8.4.1
- Add execution time limit by @VincentLanglet in #480
- @VincentLanglet made their first contribution in #480
Full Changelog: https://github.com/spatie/crawler/compare/8.3.1...8.4.0
- Upgrade spatie/browsershot to 5.0 by @hasansoyalan in #478
- @hasansoyalan made their first contribution in #478
Full Changelog: https://github.com/spatie/crawler/compare/8.3.0...8.3.1
- Add support for PHP 8.4 by @pascalbaljet in #477
Full Changelog: https://github.com/spatie/crawler/compare/8.2.3...8.3.0
- Fix setParsableMimeTypes() by @superpenguin612 in #470
Full Changelog: https://github.com/spatie/crawler/compare/8.2.2...8.2.3
- Check original URL against depth tree when visited link is a redirect by @superpenguin612 in #467
- @superpenguin612 made their first contribution in #467
Full Changelog: https://github.com/spatie/crawler/compare/8.2.0...8.2.1
- Fix wording in documentation by @adamtomat in #460
- Add Laravel/Illuminate 11 Support by @Jubeki in #461
Full Changelog: https://github.com/spatie/crawler/compare/8.1.0...8.2.0
- feat: custom link parser by @Velka-DEV in #458
- @Velka-DEV made their first contribution in #458
Full Changelog: https://github.com/spatie/crawler/compare/8.0.4...8.1.0
- allow Browsershot v4
- Fix return type by @riesjart in #452
- @riesjart made their first contribution in #452
Full Changelog: https://github.com/spatie/crawler/compare/8.0.2...8.0.3
- Define only needed methods in observer implementation by @buismaarten in #449
- @buismaarten made their first contribution in #449
Full Changelog: https://github.com/spatie/crawler/compare/8.0.1...8.0.2
- Check if rel attribute contains nofollow by @robbinbenard in #445
- @robbinbenard made their first contribution in #445
Full Changelog: https://github.com/spatie/crawler/compare/8.0.0...8.0.1
- add linkText to crawl observer methods
- upgrade dependencies
- support Laravel 10
- Feat/convert phpunit tests to pest by @mansoorkhan96 in #401
- Add the ability to change the default baseUrl scheme by @arnissolle in #402
- @arnissolle made their first contribution in #402
Full Changelog: https://github.com/spatie/crawler/compare/7.1.1...7.1.2
- Fix issue #395 by @BrokenSourceCode in #396
- @BrokenSourceCode made their first contribution in #396
Full Changelog: https://github.com/spatie/crawler/compare/7.1.0...7.1.1
- allow Laravel 9 collections
- Keep only guzzlehttp/psr7 v2.0 by @flangofas in #392
- @flangofas made their first contribution in #392
Full Changelog: https://github.com/spatie/crawler/compare/7.0.4...7.0.5
- allow psr7 v2
- change response type hint (#371)
- require PHP 8+
- drop support for PHP 7.x
- convert syntax to PHP 8
- no API changes have been made
- bugfix: infinite loops when a CrawlProfile prevents crawling (#358)
- add
setCurrentCrawlLimitandsetTotalCrawlLimit - internal refactors
- add support for PHP 8.0
- tweak variable naming in
ArrayCrawlQueue(#326)
- improve chucked reading of response
- move observer / profiles / queues to separate namespaces
- typehint all the things
- use laravel/collections instead of tightenco package
- remove support for anything below PHP 7.4
- remove all deprecated functions and classes
- treat connection exceptions as request exceptions
- fix: method and property name error (#311)
- add crawler option to allow crawl links with rel="nofollow" (#310)
- only crawl links that are completely parsed
- fix curl streaming responses (#295)
- add
setParseableMimeTypes()(#293)
- fix LinkAdder not receiving the updated DOM (#292)
- allow tightenco/collect 7 (#282)
- respect maximum response size when checking Robots Meta tags (#281)
- allow Guzzle 7
- allow symfony 5 components
- allow tightenco/collect 6.0 and up (#261)
- fix crash when
CrawlRequestFailedreceives an exception other thanRequestException
- case-insensitive user agent bugfix (#249)
- fix bugs in
hasAlreadyBeenProcessed
THIS VERSION CONTAINS A CRITICAL BUG, DO NOT USE
- added
ArrayCrawlQueue; this is now the default queue - deprecated
CollectionCrawlQueue
- Make user agent configurable (#246)
delayBetweenRequestsnow usesintinstead offloateverywhere
- remove incorrect docblock
- handle relative paths after redirects correctly
- add
getUrlsandgetPendingUrls
- Respect maximumDepth in combination with robots (#181)
- Properly handle
noindex,followurls.
- added capability of crawling links with rel= next or prev
- add
setDelayBetweenRequests
- fix an issue where the node in the depthtree could be null
- improve performance by only building the depth three when needed
- handlers will get html after JavaScript has been processed
- refactor to improve extendability
- always add links to pool if robots shouldn't be respected
- refactor of internals
- make it possible to override
$defaultClientOptions
- Bump minimum required version of
spatie/robots-txtto1.0.1.
- Respect robots.txt
- improved extensibility by removing php native type hinting of url, queue and crawler pool Closures
- do not follow links that have attribute
relset tonofollow
- Support both
Illuminate's andTighten'sCollection.
- fix bugs when installing into a Laravel app
- the
CrawlObserverandCrawlProfileare upgraded from interfaces to abstract classes - don't crawl
tel:links
- fix endless loop
- add
setCrawlObservers,addCrawlObserver
- fix
setMaximumResponseSize(someday we'll get this right)
CONTAINS BUGS, DO NOT USE THIS VERSION
- fix
setMaximumResponseSize
CONTAINS BUGS, DO NOT USE THIS VERSION
- fix
setMaximumResponseSize
CONTAINS BUGS, DO NOT USE THIS VERSION
- add
setMaximumResponseSize
- fix for exception being thrown when encountering a malformatted url
- use
\Psr\Http\Message\UriInterfacefor all urls - use Puppeteer
- drop support from PHP 7.0
- allow symfony 4 crawler
- added the ability to change the crawl queue
- more performance improvements
- performance improvements
- add
CrawlSubdomainsprofile
- add crawl count limit
- add depth limit
- add JavaScript execution
- fix deps for PHP 7.2
- add
EmptyCrawlObserver
- refactor to make use of Symfony Crawler's
linkfunction
- fix bugs around relative urls
- add
CrawlInternalUrls
- make sure the passed client options are being used
- second attempt to fix detection of redirects
- fix detection of redirects
- fix the default timeout of 5 seconds
- set a default timeout of 5 seconds
- fix for non responding hosts
- fix for the accidental crawling of mailto-links
- improve performance by concurrent crawling
- make it possible to determine on which url a url was found
- Ignore
tel:links when crawling
- Added
path,segmentandsegmentsfunctions toUrl
- Updated the required version of Guzzle to a secure version
- Fixed a bug where the crawler would not take query strings into account
- Fixed a bug where the crawler tries to follow JavaScript links
- Add support for DomCrawler 3.x
- Fix for normalizing relative links when using non-80 ports
- Add support for custom ports
- Lower required php version to 5.5
- Make url's case sensitive
- First release