Implementation:AI4Finance Foundation FinGPT AntiBot HTTP Requests
| Knowledge Sources | |
|---|---|
| Domains | Web_Scraping, Anti_Bot_Evasion, RAG |
| Last Updated | 2026-10-18 00:00 GMT |
Overview
Concrete tool for making anti-bot-protected HTTP requests with ZenRows JS rendering and randomized headers provided by the FinGPT RAG multisource_retrieval subproject.
Description
The requests_url module provides `requests_get` which uses ZenRowsClient with JS rendering and antibot bypass, randomized user agents, random sleep delays (1-5s), and session-based requests. A `requests_get_for_seeking_alpha` variant adds site-specific referer headers for Seeking Alpha scraping.
Usage
Import `requests_get` when you need to fetch pages from financial news sites that have anti-bot protections. Requires a ZenRows API key.
Code Reference
Source Location
- Repository: AI4Finance_Foundation_FinGPT
- File: fingpt/FinGPT_RAG/multisource_retrieval/requests_url.py
- Lines: 1-97
Signature
def requests_get(url, proxy=None):
"""Fetch a URL with ZenRows anti-bot bypass and randomized headers.
Args:
url: target URL
proxy: optional proxy (unused in current implementation)
Returns:
requests.Response or None on error
"""
def requests_get_for_seeking_alpha(url, subject):
"""Fetch a Seeking Alpha search URL with site-specific headers."""
Import
from requests_url import requests_get, requests_get_for_seeking_alpha
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| url | str | Yes | Target URL to fetch |
| proxy | str | No | Optional proxy (unused currently) |
| subject | str | Yes (SA) | Search subject for Seeking Alpha variant |
Outputs
| Name | Type | Description |
|---|---|---|
| response | None | HTTP response or None on error |
Usage Examples
Fetch a Protected Page
from requests_url import requests_get
response = requests_get("https://seekingalpha.com/symbol/AAPL/news")
if response and response.status_code == 200:
print(response.text[:500])