A high-performance, Playwright-powered scraper for the Jamaica Stock Exchange.
Project description
jse-scraper 🇯🇲
A robust, headless-browser Python library designed to extract real-time market data from the Jamaica Stock Exchange (JSE).
Because the JSE website uses dynamic JavaScript rendering and modern bot-protection, standard scrapers often fail. jse-scraper utilizes Playwright to mimic human browsing patterns, ensuring reliable data ingestion for your financial models.
🚀 Key Features
Dynamic Rendering: Automatically handles JavaScript-heavy tables that requests cannot see.
Stealth Mode: Mimics human behavior (scrolling, viewport management) to avoid firewall triggers.
Pandas Native: Returns data directly as a DataFrame for immediate quantitative analysis.
Auto-Cleanup: Sanitizes headers, removes currency symbols ($), and standardizes "Ordinary Shares" tables.
📦 Installation
Ensure you have a virtual environment active, then install the package and its browser dependencies:
Install the library (once published to PyPI)
pip install jse-scraper
Install the necessary Chromium browser for Playwright
playwright install chromium
🛠️ Quick Start
from jse_scraper import JSEScraper
Initialize the scraper
Set headless=False if you want to watch the 'Searcher' work in a window
scraper = JSEScraper(headless=True)
print("📡 Fetching Market Data from JSE...") df = scraper.get_trade_quotes()
if df is not None: # The library cleans headers automatically print(df[['Symbol', 'Last Traded Price', 'Volume']].head(10)) else: print("❌ Failed to retrieve data. Check your internet connection.")
📊 Why use a Headless Browser?
Most Caribbean stock exchange websites do not provide free public APIs. They rely on "Server-Side Rendering" or "Hydrated States" where data is injected into the page after it loads.
jse-scraper solves this by:
Launching a headless Chromium instance.
Navigating to the Trade Quotes page.
Waiting for the "Ordinary Shares" section to fully render.
Capturing the DOM and parsing it via lxml for maximum speed.
🏗️ Project Structure (src-layout)
jse_scraper/ ├── src/ │ └── jse_scraper/ │ ├── init.py # Package entry point │ └── scraper.py # Core Playwright & Pandas logic ├── pyproject.toml # Build system & dependencies └── README.md # Documentation
⚖️ Disclaimer
This project is an independent open-source tool and is not affiliated with, authorized, or endorsed by the Jamaica Stock Exchange. This library is intended for educational and research purposes. Users must ensure their usage complies with the JSE's Terms of Service and data redistribution policies.
👨💻 Author
Developed by a Matthew Cohen Building the data infrastructure for the next generation of Caribbean Fintech.
Project details
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 jse_scraper-0.1.3.tar.gz.
File metadata
- Download URL: jse_scraper-0.1.3.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1938c503a65df77eae6589975d187700aa71dec7484c6cc2f24ef20bb959f813
|
|
| MD5 |
2cbea31ccae4e4beefcb370c34a166c4
|
|
| BLAKE2b-256 |
5c327a3bc3a5d10083ca6187c42b3fef30fe2ad87f63d873e0675a14679624db
|
File details
Details for the file jse_scraper-0.1.3-py3-none-any.whl.
File metadata
- Download URL: jse_scraper-0.1.3-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
881650e557a390809010ef8bbde7b5d445b640bb4520ed027380be5b181758b7
|
|
| MD5 |
e85263047b40f580fb6d57bd8c73465e
|
|
| BLAKE2b-256 |
7010a18f21a3a9d0b4efe94972c6e426ee236f51ada46be43f6e25ef685542a2
|