Camoufox icon

Camoufox

Scrape websites with a stealth anti-detect browser

Extract Elements

AI-generated

Summary

Navigate to a specified URL, optionally wait for navigation and selectors, perform optional pre-extraction actions, then extract data from elements matching a CSS selector according to the specified extraction method.

Inputs

  • URL (required) — The URL to navigate to.
  • Wait Until — When to consider navigation succeeded. Options: 'DOM Content Loaded', 'Load', 'Network Idle', or 'Commit'.
  • Wait for Selector — Optional CSS selector to wait for visible after navigation, useful for dynamic or JavaScript-rendered content.
  • Timeout (Ms) — Maximum time in milliseconds to wait for navigation and selectors.
  • Actions Before Extract — Optional sequence of actions performed after navigation but before data extraction, such as clicking, filling, typing, waiting for selectors, scrolling to bottom, or delay waiting.
  • CSS Selector (required) — CSS selector to match elements to extract; each matching element becomes a separate output item.
  • Extract (required) — The type of data to extract from each matching element: text content, inner HTML, outer HTML, a specified attribute, all links under the element, or table data.
  • Attribute Name — The attribute name to extract when 'Extract' is set to 'Attribute'.

Output shape

a list of items, each corresponding to a matched element or extracted data entry

Each output item contains a JSON object with the extracted data and the URL. Extraction varies by type: text content, HTML fragments, attribute values, arrays of links, or parsed table rows. If no elements match, an item indicating zero count is output. For 'All Links' and 'Table Data' extraction, multiple items are returned, each per link or table row respectively.

Examples

Example 1: Extract all product names as text from a page

Set URL to target page, CSS Selector to product name elements, Extract to 'Text Content'.

Example 2: Extract href attributes from all links inside a specific div

Set CSS Selector to the div container, Extract to 'Attribute', Attribute Name to 'href'.

Links

Discussion