gnews
Google News
Search Google News and extract structured results via CDP. Hits Google Search's
news tab (tbm=nws) through the user's own browser, so the rendered page — not a
raw fetch — drives the extraction. No external dependencies beyond
browser-harness-js (which provides the CDP session). Each call opens its own
tab with a per-call sessionId — safe for parallel use.
Quick search
gnews "your query" # pretty-printed, up to 10 results
gnews "your query" 5 # 5 results, pretty-printed
gnews --json "your query" 3 # raw JSON
Parallel use
Each gnews call reuses the shared WebSocket but attaches to its own tab with a per-call sessionId. Tab-specific CDP calls go through cdp(sessionId, method, params). Multiple calls can run concurrently without interfering — no activeSessionId clobbering, no tab trampling, no event cross-fire. Tabs are closed fire-and-forget via Target.closeTarget so the caller isn't blocked waiting for cleanup.