📚 API ReferenceContexts
<WebBrowser>
Add web browsing support to your agent.
The WebBrowser component enables your agent to browse and interact with web pages.
Import
Usage
-
Add the component to your agent:
Additional Notes:
- The
hint
prop is optional and can be used to guide the agent's browsing behavior - For example, you could set
hint="Focus on news articles"
orhint="Only browse product pages"
- If no hint is provided, the agent will browse based on its own judgment
- The bot can:
- Navigate to URLs
- Click elements
- Fill forms
- Extract text content
- Take screenshots
- And more
- Web browsing requires a stable internet connection
- Standard rate limiting and robot policies of websites apply
- Note: if you haven't created the agent yet, please follow this Create an Agent first.
- The
Available Actions
The WebBrowser internally uses several actions for interacting with web pages:
goto
: Navigate to a URLclick
: Click an element on the pagetype
: Enter text into a form fieldextract
: Get text content from the pagescreenshot
: Capture an image of the pageevaluate
: Run custom JavaScript codewaitForSelector
: Wait for an element to appearwaitForNavigation
: Wait for page navigation to complete
Each action follows standard web automation patterns and includes error handling for common scenarios like:
- Page load failures
- Missing elements
- Navigation timeouts
- Network errors
The agent will automatically retry failed actions when appropriate and can adapt its browsing strategy based on the results.