8000 feat: Add ARIA ref-based browser automation and network request tracking by meirk-brd · Pull Request #65 · brightdata/brightdata-mcp · GitHub
[go: up one dir, main page]

Skip to content

Conversation

meirk-brd
Copy link
Collaborator

Overview

This PR enhances the browser automation tools by implementing ARIA ref-based element targeting and comprehensive network request monitoring. These changes provide more reliable web scraping capabilities and better debugging tools.

Key Changes

ARIA Ref-Based Element Targeting

  • Replaced CSS selector-based tools with ref-based alternatives for improved reliability
  • scraping_browser_snapshot: Captures ARIA snapshots showing all interactive elements with unique refs
  • scraping_browser_click_ref: Click elements using stable ref attributes instead of fragile CSS selectors
  • scraping_browser_type_ref: Type into form fields using ref-based targeting
  • scraping_browser_wait_for_ref: Wait for elements to appear using refs

Network Request Monitoring

  • scraping_browser_network_requests: View all network activity with method, URL, and status codes

Benefits

  • Higher reliability: Ref-based targeting is more stable than CSS selectors across page changes
  • Better debugging: Network request visibility helps understand page behavior
  • Improved maintainability: ARIA refs are semantic and less likely to break with UI updates
  • Enhanced automation: More robust tools for complex web scraping scenarios

Testing

  • Thoroughly tested with Claude integration
  • Validated using MCP inspector
  • Verified across multiple browser automation scenarios

Migration Notes

Tools have been renamed for clarity:

  • scraping_browser_clickscraping_browser_click_ref
  • scraping_browser_typescraping_browser_type_ref
  • scraping_browser_linksscraping_browser_snapshot

The new ref-based approach requires using scraping_browser_snapshot first to identify element refs, then using those refs with the interaction tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0