Skip to main content
Glama

scraping_browser_type

Type text into web page elements using CSS selectors to automate form filling and data entry tasks during web scraping and browser automation.

Instructions

Type text into an element

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for the element to type into
submitNoWhether to submit the form after typing (press Enter)
textYesText to type

Implementation Reference

  • The execute handler function for the 'scraping_browser_type' tool. It types text into a specified CSS selector element using page.fill() and optionally presses Enter if submit is true.
    execute: async({selector, text, submit})=>{ const page = await (await require_browser()).get_page(); try { await page.fill(selector, text); if (submit) await page.press(selector, 'Enter'); return `Successfully typed "${text}" into element: ` +`${selector}${submit ? ' and submitted the form' : ''}`; } catch(e){ throw new UserError(`Error typing into element ${selector}: ${e}`); }
  • Zod schema defining input parameters for the tool: selector (string), text (string), submit (optional boolean).
    parameters: z.object({ selector: z.string() .describe('CSS selector for the element to type into'), text: z.string().describe('Text to type'), submit: z.boolean().optional() .describe('Whether to submit the form after typing (press Enter)'), }),
  • Registration of the 'scraping_browser_type' tool (line 313) within the exported 'tools' array, conditionally based on API_TOKEN.
    export const tools = process.env.API_TOKEN ? [ scraping_browser_navigate, scraping_browser_go_back, scraping_browser_go_forward, scraping_browser_links, scraping_browser_click, scraping_browser_type, scraping_browser_wait_for, scraping_browser_screenshot, scraping_browser_get_text, scraping_browser_get_html, scraping_browser_scroll, scraping_browser_scroll_to, ] : [scraping_browser_activation_instructions];

Other Tools

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/dsouza-anush/brightdata-mcp-heroku'

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