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.1.tar.gz (3.4 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.1-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jse_scraper-0.1.1.tar.gz
  • Upload date:
  • Size: 3.4 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.1.tar.gz
Algorithm Hash digest
SHA256 3ce94ef3ce274aaf2cb72c0da92345489e9d37602fdcbbcd0881d194cac250bc
MD5 43c0a1030b308163887cc5e29ac70753
BLAKE2b-256 b1144ef40004971394758292eba5daf1e79925ea57c9e3657b4f748c9a040ba1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jse_scraper-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 31bd5708c7ad65fbe06bd1489c69589252f21790211758ac4e90d4ecaf38481d
MD5 9e8428e3815f018f38acb9f086d29a44
BLAKE2b-256 07a313d32636bfde718a330204d4929b4c3de00539c60b21e36239cca7a1d183

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