browser_select
Automates selecting elements with Select tags on web pages using CSS selectors and specified values, ideal for web automation and scraping on sites with bot protection.
Instructions
Select an element on the page with Select tag
Args:
selector: CSS selector for element to select - required
value: The value to select - required
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | ||
| value | Yes |
Implementation Reference
- Implementation of the browser_select tool handler. Uses Selenium Select to choose an option by value in a dropdown.@mcp.tool() async def browser_select( selector: str, value: str, ): """Select an element on the page with Select tag Args: selector: CSS selector for element to select - required value: The value to select - required """ assert selector, "Selector is required" assert value, "Value is required" async def select_handler(driver: uc.Chrome): select = Select(driver.find_element(By.CSS_SELECTOR, selector)) select.select_by_value(value) return await create_success_response(f"Selected {selector} with: {value}") return await tool.safe_execute( ToolContext(webdriver=await ensure_browser()), select_handler )