Headless Browser
Use the web_browse tool to open web pages, run JavaScript, click and type into elements, and extract rendered content. Ideal for SPAs and JS-heavy sites where web_fetch returns little or no content.
When to use
- User asks to open a specific URL or "go to" a page
- Site content is loaded by JavaScript and
web_fetchreturns empty or minimal HTML - User wants to interact with a page (click buttons, fill forms, scroll)
- User needs content that only appears after JS runs (e.g. infinite scroll, modals)
Tool: web_browse
Single tool with an action parameter. Maintains one browser session; use close when done to free resources.
Actions
- navigate — Load a URL. Params:
url(required), optionalwait_ms(default 2000) for JS to settle. - get_content — Get current page text as markdown. Optional
max_chars(default 50000). - get_html — Get raw HTML. Optional
max_chars. - click — Click element by CSS selector. Param:
selector. - type — Type text into element. Params:
selector,text. - js — Run arbitrary JavaScript. Param:
script. Use for complex interactions. - scroll — Scroll page. Params:
direction(down/up), optionalamount(pixels, default 500). - back / forward — Browser history.
- close — Close the session. Call when finished to release the browser.
Workflow
navigateto the URL (use higherwait_msfor heavy SPAs).- Optionally
scrollto load lazy content, thenget_contentorget_html. - To interact:
clickortypewith a CSS selector, thenget_contentif the page changed. - When done, call
close.
Tips
- Prefer
get_contentoverget_htmlfor summaries; useget_htmlonly when structure matters. - If content is missing, increase
wait_mson navigate or scroll first. - Use simple, robust selectors (e.g.
button.primary,#submit) for click/type. - Close the session when finished to avoid leaving the browser in use.