Polite Moneycontrol data collector for trading research. Respects robots.txt; no anti-bot bypass.
Project description
moneycontrol_scraper_safe
A polite Moneycontrol data collector intended for trading research.
Principles
- Respects
robots.txtfor every request viaurllib.robotparser. - No bypassing of Cloudflare, login walls, paywalls, captchas, or rate limits.
- Prefers official RSS feeds over HTML scraping.
- Adds delay between requests (default 3s, honors any declared
Crawl-delay). - Stores both raw and clean data so research is reproducible.
- Outputs pandas DataFrames plus JSON / CSV files.
If a page is disallowed by robots.txt, or the server returns 401 / 403 / 429,
the scraper stops and does not retry with tricks.
Install
pip install -r requirements.txt
Usage
# Fetch all configured RSS feeds and write clean output
python main.py rss --sentiment
# Limit to specific categories
python main.py rss --category latest_news ipo mutual_funds
# Fetch the public homepage / markets page (only if robots.txt allows)
python main.py html
# Both
python main.py all --sentiment
Set a contact email so site operators can reach you:
export MC_CONTACT="you@example.com"
Modules
| Module | Purpose |
|---|---|
config.py |
URLs, feed list, delays, paths |
robots_checker.py |
is_allowed() / crawl_delay() via urllib.robotparser |
rss_collector.py |
Polite feed fetcher using requests + feedparser |
html_collector.py |
Polite public-page fetcher (no auth, no bypass) |
parser.py |
RSS + HTML → clean pandas DataFrames |
sentiment.py |
Lightweight finance-flavoured sentiment scoring |
storage.py |
Save raw payloads (data/raw/) and clean output (data/clean/) |
cli.py |
argparse CLI: rss, html, all |
Data layout
data/
├── raw/ # JSON payloads of feeds, raw HTML pages
└── clean/ # CSV + JSON of parsed/clean DataFrames
Categories collected
Latest market news, stock news, IPO news, economy news, business news, commodity
news, personal finance news, mutual fund news, results / company headlines, and
a best-effort market overview from the public homepage / markets page (only if
robots.txt permits).
Disclaimer
This project is for personal research. Use the data in compliance with Moneycontrol's terms of service. Do not redistribute scraped content.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file moneycontrol_datascraper-0.1.1.tar.gz.
File metadata
- Download URL: moneycontrol_datascraper-0.1.1.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
597d3466d75cc219c0e921949919b611dfeca10ba4c0326659e86e4482081973
|
|
| MD5 |
611e408d9a04929fc30578573e11de48
|
|
| BLAKE2b-256 |
654d1bf4666d4a60820e02b16409188ee51c9c9bcbc5e457359fbfa4925ec13a
|
File details
Details for the file moneycontrol_datascraper-0.1.1-py3-none-any.whl.
File metadata
- Download URL: moneycontrol_datascraper-0.1.1-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11c3ff9b24cb287607e51f2a4b2b10b5019dece4f53ba1b08d74623d357ad855
|
|
| MD5 |
d0fc521fcc21cf31ecd77b0b35a39372
|
|
| BLAKE2b-256 |
5bd3194a92688bad2e7fd31cfc31b5aa0e50fbae2ace8ec6fe80dc3a13c93403
|