xhplaywright-mcp
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"playwright": {
"args": [
"@playwright/mcp@latest --headless --no-sandbox --isolated"
],
"command": "npx"
}
}
}
可用工具 (21 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
browser_close
Close the page
该工具无需必填参数,直接调用即可
browser_resize 2 个参数 需填 2 项
Resize the browser window
必填参数:width、height
browser_console_messages 1 个参数
Returns all console messages
该工具无需必填参数,直接调用即可
browser_handle_dialog 2 个参数 需填 1 项
Handle a dialog
必填参数:accept
browser_evaluate 3 个参数 需填 1 项
Evaluate JavaScript expression on page or element
必填参数:function
browser_file_upload 1 个参数
Upload one or multiple files
该工具无需必填参数,直接调用即可
browser_fill_form 1 个参数 需填 1 项
Fill multiple form fields
必填参数:fields
browser_install
Install the browser specified in the config. Call this if you get an error about the browser not being installed.
该工具无需必填参数,直接调用即可
browser_press_key 1 个参数 需填 1 项
Press a key on the keyboard
必填参数:key
browser_type 5 个参数 需填 3 项
Type text into editable element
必填参数:element、ref、text
browser_navigate 1 个参数 需填 1 项
Navigate to a URL
必填参数:url
browser_navigate_back
Go back to the previous page
该工具无需必填参数,直接调用即可
browser_network_requests
Returns all network requests since loading the page
该工具无需必填参数,直接调用即可
browser_take_screenshot 5 个参数
Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions.
该工具无需必填参数,直接调用即可
browser_snapshot
Capture accessibility snapshot of the current page, this is better than screenshot
该工具无需必填参数,直接调用即可
browser_click 5 个参数 需填 2 项
Perform click on a web page
必填参数:element、ref
browser_drag 4 个参数 需填 4 项
Perform drag and drop between two elements
必填参数:startElement、startRef、endElement、endRef
browser_hover 2 个参数 需填 2 项
Hover over element on page
必填参数:element、ref
browser_select_option 3 个参数 需填 3 项
Select an option in a dropdown
必填参数:element、ref、values
browser_tabs 2 个参数 需填 1 项
List, create, close, or select a browser tab.
必填参数:action
browser_wait_for 3 个参数
Wait for text to appear or disappear or a specified time to pass
该工具无需必填参数,直接调用即可
服务介绍
读我
概述
本项目旨在提供一个简单的示例,展示如何使用Python进行基本的数据处理。通过这个项目,你可以学习到如何读取、处理和保存数据。
环境设置
确保你的开发环境中已安装了Python 3.7或更高版本。此外,还需要安装以下库:
- pandas
- numpy
- matplotlib
可以通过运行以下命令来安装这些依赖项:
bash
pip install pandas numpy matplotlib
项目结构
project/
│
├── data/ # 存放原始数据文件
│ └── sample_data.csv
│
├── output/ # 处理后的输出文件存放位置
│
├── src/ # 源代码目录
│ ├── init.py
│ ├── data_loader.py # 数据加载模块
│ ├── data_processor.py # 数据处理模块
│ └── main.py # 主程序入口
│
└── README.md # 项目说明文档
如何运行
- 将
sample_data.csv放置在data/目录下。 - 打开终端并导航至项目根目录。
- 运行主程序:
bash
python src/main.py
功能介绍
- 数据加载:从CSV文件中读取数据,并将其转换为Pandas DataFrame对象。
- 数据清洗:移除缺失值,对某些列进行标准化处理。
- 数据分析:计算统计数据(如平均值、标准差等),并生成图表。
- 结果保存:将处理后的数据保存为新的CSV文件,并将图表保存为图片格式。
贡献指南
欢迎任何形式的贡献!如果你发现了bug或者有改进的想法,请提交issue或pull request。更多细节请参阅CONTRIBUTING.md。
许可证
本项目采用MIT许可证。详情见LICENSE文件。