Installation instructions · MCP setup · Download source code (ZIP)
Scrapling extracts data from HTML, such as product names and prices, article headings or document links. You choose the fields; Codex writes the extraction rules and saves JSON or a table. Repeated page elements can be processed without a language model.
It offers a parser that reads saved HTML page code, page fetchers, browser tools and an MCP server. A local file needs only the parser. Browser dependencies and a direct Codex connection are separate choices.
How to extract data and check fields
Installation. You need Python 3.10 or later. Codex first finds the project, checks existing dependencies and proposes an isolated environment. After approval, the assistant runs this inside that environment:
python -m pip install scrapling
The base package includes the parser, without fetchers or CLI dependencies. A script importing scrapling.fetchers or scrapling.spiders needs additional packages. Follow the relevant documented extra rather than installing everything for a local file.
A three-product example.
- Ask Codex to find your supplied HTML or create a separate practice file with three fictional products. Two have prices; the third does not. The assistant keeps the original and expected values for comparison.
- Codex selects each product card first, then its name and price. Searching all prices independently can attach a neighbour's price to the wrong product. The assistant uses null, meaning “no value”, for missing data and keeps each record's source fragment.
- Compare the JSON with the original: three records, correct names and prices, and null for the third price. Change one element's class only in a copy of the HTML and repeat extraction. If a record disappears, fix the rule and recheck every field.
- Open the resulting table or JSON and review the differences the assistant found. Keep a small test with expected values in a working project so later page changes are easier to detect.
If the page changes. Scrapling supports adaptive element selection, which must be enabled and used as documented. A similar-looking match still needs field checks. If downloaded HTML lacks the data, it may appear only after JavaScript runs. Check with an available browser before choosing a browser fetcher.
Using it from Codex. The parser only requires Codex to run Python in the project. MCP is useful when you want to invoke page-fetching tools directly from chat. The official MCP route uses the scrapling[ai] extra, browser dependencies and scrapling-mcp. Have the assistant inspect the MCP guide and obtain installation approval, then follow connecting MCP to Codex.
The MCP server can send modifying HTTP requests as well as read pages. For a public-page extraction, use read operations rather than granting every action automatically. Start with local STDIO: Codex launches a process on the computer and communicates through its input and output streams. Public hosting, browser sessions and keys require separate setup; this local example should not expose them.
What you will have
The result is JSON or a table with values tied to their source cards and explicit missing fields. Check record counts and individual values, not just whether the script exits without an error.
Where it fits. Scrapling is suitable for preparing documents for search when source pages have a repeated structure. For fields that need interpretation of complex prose, compare ScrapeGraphAI. Reading an already available file does not require a new MCP connection.
Update and disconnect. Record the package version and repeat the original and changed-HTML tests after updates. Stop the process you created and disable only its MCP entry if one was added. Remove a separate practice environment after saving your results, leaving the working project's environment alone. Browser files and other applications may live outside the Python environment.
Paste into Codex:
Find the current project, its rules and my supplied HTML. If none is supplied, create a separate practice file with three fictional products: name and price, with the third price missing. Choose unused filenames yourself and keep the original.
Use official Scrapling at https://github.com/D4Vinci/Scrapling. Check the existing environment. This local example needs only the parser, without a browser or MCP. If installation is needed, show dependencies and wait for my approval, then use a separate environment and record the version.
Select each product card first, then its fields. Save JSON and a table with name, price and source fragment. A missing price must be null, not zero. Compare all three records with expected values. Change one element class in a copy of the HTML and repeat the check; fix selection errors and recheck the whole set.
Show the result, differences and a small repeatable test. Do not call empty output successful extraction. Do not access accounts, collect comments or connect MCP for this file. Save how to run the example and remove only the practice environment you created.