> ## Documentation Index
> Fetch the complete documentation index at: https://docs.browspark.krishm.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# browser_extract

> Structured extraction: for every element matching `items`, read named fields as text or an attribute.

Structured extraction: for every element matching `items`, read named fields as text or an attribute. Returns an array of objects.

## Parameters

<ParamField body="tabId" type="integer">
  Target tab id from browser\_tabs, which lists tabs across all windows. Defaults to the agent's most recently opened usable tab, or the only usable tab. Otherwise select a listed tabId.
</ParamField>

<ParamField body="items" type="string" required>
  CSS selector for repeated items, e.g. ".product"
</ParamField>

<ParamField body="fields" type="object" required>
  field name -> selector, or \{selector, attr}
</ParamField>

<ParamField body="limit" type="integer">
   
</ParamField>

## Example

```json theme={null}
{
  "tabId": 1234,
  "items": ".product-card",
  "fields": {
    "name": "h3",
    "price": ".price",
    "link": {
      "selector": "a",
      "attr": "href"
    }
  },
  "limit": 50
}
```
