crw icon indicating copy to clipboard operation
crw copied to clipboard

Metadata `og:title`/`ogTitle`/`twitter:title` truncated at a `"` (inch mark); `canonicalUrl` contains leading/trailing whitespace and newlines

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_scrape.

Repro

crw_scrape url=https://www.jbhifi.com.au/collections/tvs/cheap-tvs-32-and-below, read metadata.

Expected

og:title = 32" & below ... (the full attribute value); canonicalUrl trimmed.

Actual

og:title, ogTitle, twitter:title are just "32", and og:description ends at ...quality 32. canonicalUrl is "\n https://www.jbhifi.com.au/collections/tvs/cheap-tvs-32-and-below\n " on collection pages (product pages are clean). Looks like the attribute value is cut at the entity-decoded ".

Frequency

Every page whose meta attributes contain " / " (1/1 checked); the whitespace issue on 4/4 collection pages.

Log excerpt

"og:title":"32","og:description":"Discover budget-friendly entertainment with JB Hi-Fi's cheap TVs, featuring quality 32"
"canonicalUrl":"\n          https://www.jbhifi.com.au/collections/tvs/cheap-tvs-32-and-below\n        "

(title is correct: 32" and Below Cheap TVs - ....)

thedancingdeveloper avatar Nov 01 '26 21:11 thedancingdeveloper

Confirmed on stock crw: ghcr.io/fastcrw/crw:latest (default config, HTTP tier, no browser). crw scrape https://www.jbhifi.com.au/collections/tvs/cheap-tvs-32-and-below --format json gives og:title: "32" and canonicalUrl: "\n https://www.jbhifi.com.au/collections/tvs/cheap-tvs-32-and-below\n ", while title is correct. So this is not caused by our renderer settings.

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

thanks for the detailed report and for checking it on stock, that made it quick to pin down.

two separate things here:

  • canonicalUrl whitespace: real bug on our side. the page wraps the href in newlines and we passed the attribute through untrimmed. fixed in #667, attribute values are now trimmed like a browser does.
  • og:title: "32": this one comes from the page itself. the served html is <meta property="og:title" content="32" and Below Cheap TVs ..."> with the inch mark unescaped, so the attribute really does end at 32 (a browser parses it the same way). title is right because it lives in <title>, not an attribute. nothing we can safely recover there without guessing.

us avatar Nov 03 '26 13:11 us

fixed in #667 and live on the hosted api now: canonicalUrl on your 32" and below page comes back as https://www.jbhifi.com.au/collections/tvs/cheap-tvs-32-and-below, no whitespace. self-hosted images pick it up with v0.40.0 (release pr #668).

og:title stays 32 for the reason above (the page's own unescaped quote). thanks again for the clean report, closing this one.

us avatar Nov 03 '26 17:11 us