browser_get_visible_html
Extract the visible HTML content of a webpage using Chrome automation, bypassing anti-bot detection for reliable web scraping and testing.
Instructions
Get the HTML of the current page
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The primary handler and registration for the 'browser_get_visible_html' tool. Decorated with @mcp.tool() to register it in the MCP server. Ensures browser is initialized, retrieves the current page's HTML source using driver.page_source, and returns it wrapped in a success response.@mcp.tool() async def browser_get_visible_html(): """Get the HTML of the current page""" async def get_visible_html_handler(driver: uc.Chrome): return await create_success_response(driver.page_source) return await tool.safe_execute( ToolContext(webdriver=await ensure_browser()), get_visible_html_handler )