Skip to main content

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

jse_scraper-0.1.2.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jse_scraper-0.1.2-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file jse_scraper-0.1.2.tar.gz.

File metadata

  • Download URL: jse_scraper-0.1.2.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

Hashes for jse_scraper-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d48a0830395a44b49e532fc6887bb89064b71c17ae34269aa3388f77876bb82f
MD5 b2529aab9ef93629aca852320bdedc21
BLAKE2b-256 63d0fba200a3f6ebb18ab5ec3ed12eea99fbc2aa086ced435b91b089b943fe07

See more details on using hashes here.

File details

Details for the file jse_scraper-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: jse_scraper-0.1.2-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

Hashes for jse_scraper-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 58b0c8eeedfe1ed9adb212c253b42b21129aef9f2b1e8a028e3beb259047d7c9
MD5 cdfe813187643cd6613dca7c13fd7f26
BLAKE2b-256 6017740957f01946e844d10e00212cc56edad2cfcd0e6254c5e5278060c8a29b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page