McMaster-Scraper
A Python library for fetching product tables from a McMaster-Carr URL as a DataFrame for complex filtering and calculations.
Features
- Caches data locally to speed up future calls
- Supports both sync/async APIs
- Works in Python files and Jupyter notebooks
- Includes convenience functions to quickly retrieve product tables from multiple URLs
- Typed functions for type-checking compatibility
Install
McMaster-Scraper is available on PyPi:
pip install mcmaster-scraper
McMaster-Scraper requires Playwright to fetch the product tables. It is already included as a dependency. However, you will need to install the browsers manually:
playwright install
Quick Start
To use the Sync API, import the sync_api module and call get_products_from_url(s):
from mcmaster_scraper.sync_api import get_products_from_url
url = "https://www.mcmaster.com/products/screws/socket-head-screws-2~/steel-socket-head-screws~~/"
data = get_products_from_url(url) # Returns a DataFrame with all the products from the URL
... # Do stuff with the DataFrame (filter, perform calculations, etc.)
Using the Async API is similar, import the async_api module and await the function call:
from mcmaster_scraper.async_api import get_products_from_url
url = "https://www.mcmaster.com/products/screws/socket-head-screws-2~/steel-socket-head-screws~~/"
data = await get_products_from_url(url) # Returns a DataFrame with all the products from the URL
... # Do stuff with the DataFrame (filter, perform calculations, etc.)
Docs
API Reference
The API reference can be found on GitHub Pages.
Examples
An example script can be found in docs/example.py.
Known Limitations
Some pages generate server-side HTML rather than client-side rendering a JSON response.
These pages are currently unsupported but may be supported in the future.
UnsupportedOperation will be raised for such pages.
Disclaimer
This library is for responsible data extraction only. Do not:
- Scrape beyond reasonable rates
- Violate Terms of Service
- Circumvent access controls
- Use data for unauthorized commercial purposes
Legal Notice
This library is provided as-is. Authors are not liable for any legal, technical, or business consequences resulting from misuse of this library. Users assume full responsibility for compliance with applicable laws, regulations, and website policies.
By using this library, you acknowledge and agree to these responsibilities.
License
Metadata
Release files for mcmaster-scraper 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mcmaster_scraper-0.2.1.tar.gz | 7.1 kB | Without provenance | Details for mcmaster_scraper-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mcmaster_scraper-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for mcmaster_scraper-0.2.1-py3-none-any.whl |
Total release size: 17.7 kB
Release files / mcmaster_scraper-0.2.1.tar.gz
| Download URL | mcmaster_scraper-0.2.1.tar.gz |
|---|---|
| Size | 7.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3d2c30a2decc89d203b111b847cfc3d27d2ead31291373bbadc470a4d61b059e
|
|
BLAKE2b-256 checksum How to use checksums |
6f5728cb31b62d52237d9f76dc1065ca2961fd68d88e633f8fff0597010ad947
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / mcmaster_scraper-0.2.1-py3-none-any.whl
| Download URL | mcmaster_scraper-0.2.1-py3-none-any.whl |
|---|---|
| Size | 10.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e9018ad66358b565d83f0eba84a5bc137b761092286470ac62c5941b4f771ddb
|
|
BLAKE2b-256 checksum How to use checksums |
9c0ee157f360209a2f0656d5aca5a627d4e92bf6e86ecf48982025ca52052349
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for mcmaster-scraper 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.