Custom Parser
See the steps for a quick start with Oxylabs Custom Parser.
Custom Parser is a free Web Scraper API feature that lets you create parsing and data processing logic that’s executed on a raw HTML result. You can automatically generate parsers using AI or write them manually for advanced scenarios.
For in-depth instructions and examples, refer to these pages:
Quick start
1. Generate a parser
We recommend starting out with our AI-powered OxyCopilot tool that lets you generate scrapers and parsers without writing any code.
Follow the steps shown in the video to generate a parser:
Here are the same steps shown in the video:
Enter the URL(s) you want to scrape and parse
Specify any parameters such as JavaScript rendering
Write a prompt that describes what you want to parse
Run OxyCopilot
Once you’re happy with the generated parser, load the instructions.
2. Save the parser as a preset
You can easily save your generated parsers through OxyCopilot for later use. See the steps below:
Assign the preset to a specific API user
Click Save
Enter the preset name and the description (optional)
After saving the preset, you can use it with API requests.
3. Use the parser with API requests
To use your preset with Web Scraper API, send a payload with the parser_preset parameter set to your preset name. In the code samples below, we're reusing the example_parser preset created in previous steps.
Getting the HTML content of a parsed job
A parsed job can also return the raw HTML it was parsed from: add the type query parameter with raw (or parsed,raw for both) to the Realtime endpoint or to the Push-Pull result URL. See Multi-format Output.
Last updated
Was this helpful?