导航
🌐 Navigation
| 工具 | 描述 |
|---|---|
browser_navigate | 导航到一个网址 |
browser_navigate_back | 返回上一页 |
browser_navigate_forward | 前进到下一页 |
browser_reload | 重新加载当前页面 |
browser_close | 关闭当前页面和浏览器 |
browser_navigate
在当前标签页中导航到一个网址。
🌐 Navigate to a URL in the current tab.
| 参数 | 类型 | 必需 | 描述 |
|---|---|---|---|
url | 字符串 | 是 | 要导航的 URL |
You: Go to https://demo.playwright.dev/todomvc
→ browser_navigate { url: "https://demo.playwright.dev/todomvc" }
→ Returns snapshot of the loaded page:
- heading "todos" [level=1]
- textbox "What needs to be done?" [ref=e5]
browser_navigate_back
返回浏览器历史记录中的上一页。
🌐 Go back to the previous page in the browser history.
You: Go back to the previous page.
→ browser_navigate_back
→ Returns snapshot of the previous page
browser_navigate_forward
在浏览器历史记录中前进到下一页。
🌐 Go forward to the next page in the browser history.
You: Go forward.
→ browser_navigate_forward
browser_reload
重新加载当前页面。
🌐 Reload the current page.
You: Reload the page.
→ browser_reload
→ Returns fresh snapshot after reload
browser_close
关闭当前页面和浏览器。
🌐 Close the current page and browser.
→ browser_close
工作流程示例
🌐 Workflow example
You: Open the TodoMVC app, add an item, then go back to see
if the item persists.
→ browser_navigate { url: "https://demo.playwright.dev/todomvc" }
→ browser_type { ref: "e5", text: "Buy groceries", submit: true }
→ browser_navigate { url: "https://example.com" }
→ browser_navigate_back
→ browser_snapshot
- heading "todos" [level=1]
- textbox "What needs to be done?" [ref=e5]
- listitem:
- checkbox "Toggle Todo" [ref=e10]
- text: "Buy groceries"