跳到正文
Skillpedia
测试18k · #10653

browser-automation

它能做什么

这个技能提供使用 Playwright 自动化网页浏览器的参考模式,包括表单、导航和购物页面的 CSS 选择器。适合希望 AI 智能体自行点击、输入和读取网站的人。

适用场景

  • ✓当你希望 AI 智能体填写网页表单或在网站中逐步点击时。
  • ✓当你需要在页面上可靠地找到按钮、输入框、链接或下拉菜单时。
  • ✓当自动化任务需要从商店页面读取商品价格或购物车总额时。

技能链接

https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-hands/bundled/browser/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-hands/bundled/browser/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请让我的助手打开我们的网上商店,把一件商品加入购物车,然后读出总额。”

每周 5 个新技能,1 分钟读完。

工作原理

该技能列出常用的 CSS 选择器和模式,使智能体能够找到页面元素并以一致的方式与之交互。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Browser Automation Skill

Playwright CSS Selector Reference

Basic Selectors

Selector Description Example
#id By ID #checkout-btn
.class By class .add-to-cart
tag By element button, input
[attr=val] By attribute [data-testid="submit"]
tag.class Combined button.primary

Form Selectors

Selector Use Case
input[type="email"] Email fields
input[type="password"] Password fields
input[type="search"] Search boxes
input[name="q"] Google/search query
textarea Multi-line text areas
select[name="country"] Dropdown menus
input[type="checkbox"] Checkboxes
input[type="radio"] Radio buttons
button[type="submit"] Submit buttons

Navigation Selectors

Selector Use Case
a[href*="cart"] Cart links
a[href*="checkout"] Checkout links
a[href*="login"] Login links
nav a Navigation menu links
.breadcrumb a Breadcrumb links
[role="navigation"] a ARIA nav links

E-commerce Selectors

Selector Use Case
.product-price, [data-price] Product prices
.add-to-cart, #add-to-cart Add to cart buttons
.cart-total, .order-total Cart total
.quantity, input[name="quantity"] Quantity selectors
.checkout-btn, #checkout Checkout buttons

Common Workflows

Product Search & Purchase

1. browser_navigate → store homepage
2. browser_type → search box with product name
3. browser_click → search button or press Enter
4. browser_read_page → scan results
5. browser_click → desired product
6. browser_read_page → verify product details & price
7. browser_click → "Add to Cart"
8. browser_navigate → cart page
9. browser_read_page → verify cart contents & total
10. STOP → Report to user, wait for approval
11. browser_click → "Proceed to Checkout" (only after approval)

Account Login

1. browser_navigate → login page
2. browser_type → email/username field
3. browser_type → password field
4. browser_click → login/submit button
5. browser_read_page → verify successful login

Form Submission

1. browser_navigate → form page
2. browser_read_page → understand form structure
3. browser_type → fill each field sequentially
4. browser_click → checkboxes/radio buttons as needed
5. browser_screenshot → visual verification before submit
6. browser_click → submit button
7. browser_read_page → verify confirmation

Price Comparison

1. For each store:
   a. browser_navigate → store URL
   b. browser_type → search query
   c. browser_read_page → extract prices
   d. memory_store → save price data
2. memory_recall → compare all prices
3. Report findings to user

Error Recovery Strategies

Error Recovery
Element not found Try alternative selector, use visible text, scroll page
Page timeout Retry navigation, check URL
Login required Inform user, ask for credentials
CAPTCHA Cannot solve — inform user
Pop-up/modal Click dismiss/close button first
Cookie consent Click "Accept" or dismiss banner
Rate limited Wait 30s, retry
Wrong page Use browser_read_page to verify, navigate back

Security Checklist

  • Verify domain before entering credentials
  • Never store passwords in memory_store
  • Check for HTTPS before submitting sensitive data
  • Report suspicious redirects to user
  • Never auto-approve financial transactions
  • Warn about phishing indicators (misspelled domains, unusual URLs)
常见问题

什么是 Playwright?

它是一个让代码控制网页浏览器的工具,例如点击、输入和读取页面。

什么是 CSS 选择器?

它是一种简短的模式,用来标识网页的某个部分,例如带有特定 ID 或类名的按钮。

它对网上商店有帮助吗?

有帮助。该技能包括商品价格、加入购物车按钮和购物车总额的选择器。

详情

作者的原始描述

Playwright-based browser automation patterns for autonomous web interaction

repo: RightNow-AI/openfang

热度

GitHub 星标
18k
排名
#10653
许可证
Apache-2.0
更新时间
2026/7/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能