Skip to main content
Glama

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
NameRequiredDescriptionDefault
selectorYes
valueYes

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 )

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dragons96/mcp-undetected-chromedriver'

If you have feedback or need assistance with the MCP directory API, please join our Discord server