Sitemap Extractor: overlap sitemap download with crawling (enqueue URLs as they are parsed, don't block on full enumeration)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 47/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- typescript
Direzione di ricerca
Start by locating the sitemap ingestion code that calls Crawlee's Sitemap.load() and then adds sitemap.urls to the request queue; the issue does not name the relevant files or tests. Review Crawlee's Sitemap.fromXmlString() API and how the crawler is started. Done means child sitemap URLs enter the queue as they are parsed, bounded concurrency is respected, and crawling proceeds concurrently rather than waiting for full sitemap enumeration.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
When useSitemaps is enabled, the scrapers currently enumerate the entire sitemap tree before the crawler processes any page. For large sites whose sitemap index references hundreds of child sitemaps, this serial "download-all-sitemaps-first" phase dominates run time and frequently exhausts the run timeout before real crawling even begins.
Proposal: stream sitemap URLs into the request queue as each child sitemap is parsed, and start the crawler concurrently, so sitemap I/O overlaps with page processing.
Evidence
From a large-scale test — 500 domains (250 most-popular + 250 random), run through a Crawlee-based Sitemap Extractor over an Apr–Jun 2026 usage window:
- Top-250 popular sites averaged ~2,355 sitemap URLs/domain vs ~290 for the random sample (~8× more).
- 83 of 500 runs hit the 1-hour timeout, disproportionately the large sites — they spent the bulk of the run downloading/parsing sitemaps and never got through the enqueued links. Their discovered-page counts are truncated as a result.
Root cause
Crawlee's Sitemap.load() (the standard path) collects every URL from the whole sitemap tree — following the sitemap index and all child sitemaps — into a single urls array, and only returns once complete. The actor then calls crawler.addRequests(sitemap.urls). So wall-clock is effectively sitemap_download_time + crawl_time, fully serial.
(Confirmed against the Crawlee Sitemap API, which exposes load() / fromXmlString() / tryCommonNames() but no incremental/streaming consumption — all URLs surface only after the full tree is loaded.)
Proposed fix
Turn sitemap ingestion into a producer/consumer that overlaps with crawling:
- Fetch the sitemap index first to obtain the list of child-sitemap URLs.
- Download child sitemaps with a bounded-concurrency pool (e.g. 10–20), parsing each with
Sitemap.fromXmlString()(or a streaming parser) rather than the monolithicload(). - As each child sitemap resolves, immediately
await requestQueue.addRequests(batch)— don't wait for the rest. - Start the crawler concurrently (don't
awaitfull enumeration). Crawlee's autoscaled pool pulls URLs as soon as they land in the queue.
Result: wall-clock drops from sitemap_time + crawl_time to roughly max(sitemap_time, crawl_time), and large sites make real crawl progress before hitting the timeout.
Notes
- Cap per-host sitemap concurrency to avoid triggering anti-bot (see the related Unblocker issue).
- Complements a separate sitemap download-optimization issue (streaming XML, gzip, keep-alive, incremental skip).
🤖 Filed from a data-driven analysis with Claude Code, based on a 500-domain Sitemap Extractor test (Apr–Jun 2026).
- Lingua principale
- TypeScript
- Stelle
- 149
- Fork
- 59
- Merge medio
- 9g 13h
- PR unite (30g)
- 3
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apify/actor-scraper
-
t-universe
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
apify/actor-scraper#366 · 1 commento ·
-
t-universe
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
apify/actor-scraper#365 · 1 commento ·
-
t-universe
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
apify/actor-scraper#362 · 2 commenti ·
-
Fix updating changelogs for generic scrapersForse già presa @nikitachapovskii-dev l’ha presa 9 giorni fa. Apertat-universe
apify/actor-scraper#359 · 1 assegnatario ·
-
Sitemap Extractor: fall back to Apify Unblocker when sitemap/robots.txt fetch is blocked (HTTP 403)Apertat-universe
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
apify/actor-scraper#341 · 1 commento ·
Tutte le issue di apify/actor-scraper
Issue simili
-
Create/import wallet form shows raw "password must be at least 1 characters" instead of the translated messageForse già presa @CapThunder19 l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
joinmarket-webui/jam#1538 ·
I maintainer di solito rispondono entro 1 giorno
-
t0ggles
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
nolimits4web/swiper#8240 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
modelcontextprotocol/inspector#2723 ·
I maintainer di solito rispondono entro 1 giorno
-
status:approved type:bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 70/100
egdev6/quorb#109 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno