# browser_pick

## Browser Pick

Select an option from a dropdown or select element. Works with native HTML select elements and dynamic/custom dropdowns (like select2, react-select). Specify the option by its value or visible text. Automatically handles opening the dropdown and selecting the option.

## Usage Example

### Python SDK

```python
POST `/api/execute/browser_pick`
```

```bash
curl -X POST \
 -H "Authorization: Bearer <token>" \
 -H "Content-Type: application/json" \
 -d '{
"context_id": "ctx_000001",
"selector": "#element-id",
"value": "<value>"
}' \
http://localhost:8080/api/execute/browser_pick
```

### Node.js SDK

```python
import asyncio

from owl_browser import OwlBrowser, RemoteConfig

# Async usage
async with OwlBrowser(config) as browser:
    context = await browser.create_context()
    context_id = context["context_id"]
    await browser.pick(
        context_id=context_id,
        selector="#element-id",
        value="value"
    )
```

### CURL

```javascript
import { OwlBrowser } from '@olib-ai/owl-browser-sdk';

// Async usage
const ctx = await browser.createContext();
const contextId = ctx.context_id;
await browser.pick({
    context_id: contextId,
    selector: '#element-id',
    value: 'value'
});
```

## Parameters

### Required

- `context_id` string required  
  The unique identifier of the browser context (e.g., 'ctx_000001')
- `selector` string required  
  Target dropdown/select element. Accepts CSS selector (e.g., '#country', 'select[name="size"]') or natural language description (e.g., 'country dropdown', 'size selector')
- `value` string required  
  The option to select. Can be the option's value attribute OR the visible display text. Works with both native select elements and dynamic dropdowns (select2, etc.)

## Response

Returns a JSON object with the operation result.

```
{
  "success": true,
  "result": <value>
}
```
