Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:AI4Finance Foundation FinGPT Multi Source News Scraping

From Leeroopedia
Knowledge Sources
Domains Web_Scraping, Information_Retrieval, Finance
Last Updated 2026-10-18 00:00 GMT

Overview

The process of extracting financial news articles from multiple web sources (Yahoo Finance, CNBC, Google, MarketScreener, Seeking Alpha) using HTTP requests, HTML parsing, and browser automation.

Description

Multi-source news scraping aggregates financial articles from diverse providers to build a comprehensive context base for RAG. Each source requires a dedicated scraper that handles its unique HTML structure, URL patterns, and content extraction logic. The `scraping_by_url` orchestrator dispatches to source-specific scrapers based on URL domain matching.

The scrapers extract article text (headlines, summaries, body paragraphs) and filter for relevance using a word-overlap similarity score against the query subject. Articles below the similarity threshold are discarded; relevant articles have their text appended to the subject for context augmentation.

Usage

Use this principle when:

  • Building a news corpus for RAG: Aggregating articles from multiple financial news sources.
  • Context retrieval: Finding relevant articles to augment financial statement classification.
  • Multi-source aggregation: Combining Yahoo, CNBC, Google, MarketScreener, and Seeking Alpha.

Theoretical Basis

Multi-source scraping follows a dispatch-and-extract pattern:

context(q)=⋃s∈Sscrapes(search(q),q)

Where S is the set of sources and scrapes extracts and filters articles from source s for query q.

Each scraper follows the pattern:

# Abstract: source-specific scraper
def scrape_source(url, subject):
    html = requests.get(url).content
    soup = BeautifulSoup(html, 'html.parser')
    article_text = extract_paragraphs(soup)
    if similarity_score(article_text, subject) >= threshold:
        return url, subject + ". With full context: " + article_text
    return "N/A", subject

Practical Guide

  • Set the similarity threshold per source (0.8 default, 0.75 for Google).
  • Use `requests_get` for HTTP requests with retry logic.
  • Seeking Alpha has two paths: direct article URLs and XML sitemap-based discovery.
  • Some sources require Selenium for JavaScript-rendered content.
  • Strip boilerplate content to reduce noise in retrieved context.

Related Pages

Implemented By

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment