CME.py
automates the process of scraping trading hours data from the CME Group Trading Hours page using the playwright library. It extracts product names and their associated trading hours, then saves the data into a timestamped CSV file for easy analysis or record-keeping.playwright.async_api
: Automates a Chromium browser to interact with dynamic web content.csv
: Writes the scraped data to a CSV file.datetime
: Generates timestamps for unique CSV filenames.asyncio
: Manages asynchronous operations for efficient web scraping.playwright
.https://www.cmegroup.com/trading-hours.html
.datetime
to ensure each CSV file has a unique name (e.g., trading_hours_20231024_153022.csv
).Product Name
, Trade Group
, and Trade Group Text
.get_data
function extracts data from a table displayed after each filter is applied.product-code
column.events-data
columns, which contain trading hours details.Posted Apr 13, 2025
Automated scraping of CME Group trading hours using Python and Playwright.
0
0