Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Sitemap Extractor: overlap sitemap download with crawling (enqueue URLs as they are parsed, don't block on full enumeration)

Abierto
#339 10 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
47/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
typescript
Área
backend, web-dev

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

t-universe

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:

  1. Fetch the sitemap index first to obtain the list of child-sitemap URLs.
  2. Download child sitemaps with a bounded-concurrency pool (e.g. 10–20), parsing each with Sitemap.fromXmlString() (or a streaming parser) rather than the monolithic load().
  3. As each child sitemap resolves, immediately await requestQueue.addRequests(batch) — don't wait for the rest.
  4. Start the crawler concurrently (don't await full 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).

Lenguaje dominante
TypeScript
Estrellas
149
Forks
59
Merge medio
7 h 19 min
PR fusionados (30 d)
1

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de apify/actor-scraper

Todos los issues de apify/actor-scraper

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.