Skip to main content
When you know exactly which elements you want, send a map of names to CSS selectors with css_extractor and Zenrows returns those values as JSON. For common data such as tables, links, emails or headings, outputs does it with no selectors at all. And when you’d rather keep your own parser, fetch the HTML and run BeautifulSoup or Cheerio on it. Uses: Fetch with css_extractor, outputs and Adaptive Stealth Mode (mode=auto)

Ask your AI agent

With the Zenrows MCP server connected to Claude, Cursor or any MCP client, paste this prompt. Your agent picks the right Zenrows tools and settings on its own.

Extract elements with css_extractor

Send css_extractor as a JSON object: each key is the name you want in the output, each value is a CSS selector. Fetch applies the selectors to the rendered page and returns JSON instead of HTML.
In cURL, URL-encode the JSON. The Python and Node.js clients encode it for you. In the CLI, zenrows extract --css sends css_extractor and --outputs sends outputs.

Example output

Trimmed to three products:

How selectors map to JSON

Any CSS selector works: attribute filters such as a[href*='/product/'], combinators such as .product .price, and pseudo-classes such as li:first-child. Test a selector in your browser’s console with document.querySelectorAll(...) before you send it.

Get common data with outputs

For data every site shares, skip selectors. outputs takes a comma-separated list of filters: emails, phone_numbers, headings, images, audios, videos, links, menus, hashtags, metadata, tables and favicon, or * for all of them. Tables come back as rows keyed by their column headings.
Output (trimmed)

Using external libraries

When you need parsing logic of your own, such as reading one product card at a time so each name stays paired with its price, request the HTML and parse it with your favorite library. Zenrows still handles rendering and anti-bot protection.

Python with BeautifulSoup

Python (Requests)
Output

JavaScript with Cheerio

Node.js

Which method to choose

Customize it

Troubleshooting

  • A key comes back as an empty string: the selector matched nothing in the final HTML. Check it against the page with your browser’s console, and if the element loads late, switch to js_render=true with wait_for set to that selector.
  • You get HTML instead of JSON: the css_extractor value isn’t valid JSON or isn’t encoded. Build it with json.dumps or JSON.stringify, and URL-encode it in cURL.
  • Values from different products don’t line up: separate arrays lose the grouping when one card lacks a field. Parse one card at a time with BeautifulSoup or Cheerio.
  • 413 response: the page is very large. css_extractor or outputs returns just the data you ask for and keeps responses small.

Get structured JSON from any page

Let Extract find the fields for you, no selectors needed.

Crawl a website from a start URL

Collect every product URL, then extract each page.

Scrape a list of URLs

Apply the same selectors to thousands of pages in one job.

Turn any web page into LLM-ready markdown

Hand a whole page to an LLM as clean markdown.