crw icon indicating copy to clipboard operation
crw copied to clipboard

`crw_map` on a collection URL returns unrelated site-wide collection URLs, no products, and nothing under the given path

Open thedancingdeveloper opened this issue 1 month ago • 3 comments

Environment

  • Self-hosted crw nightly on Node B, images pulled 2026-11-01, MCP crw_map.

Repro

crw_map url=https://www.jbhifi.com.au/collections/tvs/cheap-tvs, limit: 200 (defaults otherwise).

Expected

URLs under or linked from that page (e.g. /products/... entries, or at least /collections/tvs/*), or a documented "site-wide" behaviour with a path/prefix filter.

Actual

~200 URLs, alphabetical, drawn from sitemap-subcollections.xml: phone cases, Garmin watches, car audio, pet toys, etc. Only ~15 are under /collections/tvs/. None are /products/ URLs, and the page's own product links are not included. limit truncates alphabetically, so the TV products never appear at any small limit. Result: crw_map was not useful for discovering the products, and I used crw_scrape with formats: ["links"] instead.

Frequency

1/1; deterministic by design of the sitemap-first path.

Log excerpt

links[0]: https://www.jbhifi.com.au/collections/collectibles-merchandise/action-figures
links[..]: .../iphone-17-pro-max-cases, .../pet-water-fountains
sitemaps: [".../sitemap.xml","http://www.jbhifi.com.au/sitemap-subcollections.xml"]

thedancingdeveloper avatar Nov 01 '26 21:11 thedancingdeveloper

Confirmed on stock crw: ghcr.io/fastcrw/crw:latest (default config). crw map https://www.jbhifi.com.au/collections/tvs/cheap-tvs returns the site-wide sitemap list in alphabetical order (first entries /agents.md, /blogs/competitions/...), not URLs under the given path. Renderer settings are not involved.

Disclosure: this was run on a third-party build, swack-tools/crw-build-aio-mcp, from crw 147c8d6 plus that repo's patches, with non-default renderer settings (RENDERER__MODE=chrome, RENDER_JS_DEFAULT=true, CHROME_INTERCEPT_RESOURCES=false, CHROME_CONTEXT_POOL_ENABLED=false). Sorry for not saying so when filing.

thedancingdeveloper avatar Nov 02 '26 02:11 thedancingdeveloper

good catch, confirmed. a section url filled the cap from the site-wide sitemap before the page's own section was ever looked at, and limit then cut it alphabetically.

#667 adds filterByPath (default true): when the url has a path, map returns only urls under it. sitemap entries are scoped before the cap, so the cap fills with in-scope urls. on your example crw map https://www.jbhifi.com.au/collections/tvs/cheap-tvs --limit 200 now returns the seed plus the four size sub-collections (cheap-tvs-32-and-below, -40-43, -50-55, -65-and-above) and nothing else. filterByPath: false (cli: --no-filter-by-path) maps the whole site like before.

product pages live under /products/, outside the collection path, so they are not part of a scoped map. for the product links on one page, crw_scrape with formats: ["links"] is the right tool, as you found.

us avatar Nov 03 '26 13:11 us

fixed in #667, plus #669 which keeps a scoped map of a small section fast on a big site. live on the hosted api now: map on /collections/tvs/cheap-tvs returns the seed and the four size sub-collections, nothing out of scope, in about 40s on that site (it read every sitemap before). filterByPath: false gives the old site-wide list.

self-hosted images get it with v0.40.0 (release pr #668). thanks for the sharp repro, closing.

us avatar Nov 03 '26 17:11 us