News
Verified
Google News Scraper
Extract news articles, headlines, publication sources, and trending stories from Google News. Built on spider-browser .
- target
- news.google.com
- success rate
- 99.9%
- latency
- ~4ms
Quick start
Extract data in minutes.
google-news-scraper.ts
import { SpiderBrowser } from "spider-browser";
const spider = new SpiderBrowser({
apiKey: process.env.SPIDER_API_KEY!,
stealth: 2,
});
await spider.connect();
const page = spider.page!;
await page.goto("https://news.google.com/topics/CAAqJggKIiBDQkFTRWdvSUwyMHZNRFZxYUdjU0FtVnVHZ0pWVXlnQVAB");
await page.content(10000);
const data = await page.evaluate(`(() => {
const articles = [];
document.querySelectorAll("article").forEach(el => {
const headline = el.querySelector("h3 a, h4 a, a[href*='./articles/']")?.textContent?.trim();
const source = el.querySelector("a[data-n-tid]")?.textContent?.trim()
|| el.querySelector("time")?.closest("div")?.querySelector("a")?.textContent?.trim();
const time = el.querySelector("time")?.getAttribute("datetime");
if (headline) articles.push({ headline, source, time });
});
return JSON.stringify({ total: articles.length, articles: articles.slice(0, 10) });
})()`);
console.log(JSON.parse(data));
await spider.close(); ready to run · spider-browser · TypeScript
Extraction
Fields you can pull.
HeadlineSourceArticle URLPublished dateCategorySnippetImage URLRelated articles
Freshness
Real-time headlines
Capture breaking news and trending stories as they publish.
Sources
Multi-publication
Aggregate articles from thousands of publications in a single scrape.
Parsing
Article extraction
Clean article text, images, and metadata from complex news layouts.
Related
More News scrapers.
Start
Start scraping news.google.com.
Grab an API key and call the endpoint above. The first request resolves the config; every request after hits cache.