feat(actor-scraper): add sitemap scraper - #205
Merged
Merged
Conversation
foxt451
commented
Dec 18, 2025
foxt451
added a commit
to apify/crawlee
that referenced
this pull request
Jan 19, 2026
Related to https://github.com/apify/apify-sdk-js/issues/486. I'm [developing generic sitemap scraper](apify/actor-scraper#205) and it's going to share a big utility function (main chunk of logic) with wcc - `discoverValidSitemaps`. I've asked @barjin if I could factor it out and he told this util could fit into crawlee. It's mainly copied from wcc, but to keep the dependencies unchanged, it's using got-scraping to check for url existence instead of impit (I think it doesn't matter for sitemaps), and `urlExists` is inlined (until we don't add http client to these utils in v4 as @barjin told me). It's also turned into an async generator. Let me know if you see a better place for this util.
barjin
pushed a commit
to apify/crawlee
that referenced
this pull request
Feb 6, 2026
Related to https://github.com/apify/apify-sdk-js/issues/486. I'm [developing generic sitemap scraper](apify/actor-scraper#205) and it's going to share a big utility function (main chunk of logic) with wcc - `discoverValidSitemaps`. I've asked @barjin if I could factor it out and he told this util could fit into crawlee. It's mainly copied from wcc, but to keep the dependencies unchanged, it's using got-scraping to check for url existence instead of impit (I think it doesn't matter for sitemaps), and `urlExists` is inlined (until we don't add http client to these utils in v4 as @barjin told me). It's also turned into an async generator. Let me know if you see a better place for this util.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The framework was mostly copied from cheerio-scraper (but trimmed in a lot of places), and the request handler inspired by sitemap scraper in WCC.
There has been discussion of how to avoid duplicating code between wcc and here, and some advised to extract sitemap scraper into a package. But I then checked the code of sitemap crawler in WCC, and it's really coupled to wcc, and itself is quite short, so I just copied it over with modifications.
BUT, the one thing I copied without changes at all isdiscoverValidSitemapsutil from WCC. I'd like to extract it somewhere e.g. intoscraper-tools, because it seems like quite a generic function.Tested locally - for now will just push dataset items with a url and status code for each page.
Closes #220