A LangGraph pipeline that scrapes news articles with ZenRows, extracts structured fields with an LLM, and synthesizes a short briefing.
The graph (graph.py) wires together four nodes (nodes.py):
- scrape — fetches each URL with
ZenRowsUniversalScraper(JS rendering + premium proxy). - retry — if a scrape looks blocked (bot-check page, empty response), retries once with a US proxy.
- extract — asks
gpt-4o-minito pullheadline,source,date, andsummaryfrom each article as JSON. - synthesize — asks the LLM to turn the extracted articles into a short bullet-point briefing.
scrape --(blocked?)--> retry --> extract --> synthesize --> END
\_________________(ok)_______/
pip install -r requirements.txtCreate a .env file in the project root with:
ZENROWS_API_KEY=your_zenrows_api_key
OPENAI_API_KEY=your_openai_api_key
python graph.pyThis scrapes a hardcoded list of URLs (edit the urls list in graph.py to change targets), prints the extracted fields, and prints the final briefing.