运行时依赖
安装命令
点击复制技能文档
Browser File 上传
Automates file 上传s to 网页 pages using 代理-browser 命令行工具.
Quick 启动
上传 a file to a 网页 page:
# Basic 上传 (auto-检测s file 输入) 代理-browser open 代理-browser find text 选择文件 命令行工具ck 代理-browser 上传 "#filePicker"
# Or use the Python script python scripts/上传_file.py
Usage Patterns 上传 to Specific Selector
When you know the file 输入 selector:
代理-browser open https://example.com/上传 代理-browser 命令行工具ck "#file输入" 代理-browser 上传 "#file输入" C:\path\to\file.xlsx
上传 by Text 搜索
When file 输入 has visible label text:
代理-browser open https://example.com/上传 代理-browser find text "上传文件" 命令行工具ck 代理-browser 上传 "[type=file]" C:\path\to\file.xlsx
Using Python Script
For reusable 上传 记录ic with flexible path specification:
python scripts/上传_file.py [selector] [wAIt_ms]
Arguments:
url - Tar获取 page URL file-path - Path to file (supports multiple 格式化s, see below) selector - Optional CSS selector for file 输入 wAIt_ms - Optional wAIt time after page load (default: 2000) File Path 格式化s
The Python script supports multiple path 格式化s:
格式化 Example Description Absolute C:\Users\name\file.xlsx Full path Relative ./data/file.xlsx Relative to current directory Workspace workspace/file.xlsx Relative to OpenClaw_WORKSPACE Env Var ${HOME}/file.xlsx 环境 variable Windows Env %USER性能分析%\file.xlsx Windows 环境 variable Path Examples # Absolute path python scripts/上传_file.py https://example.com C:\Users\陈\Documents\data.xlsx
# Relative path (from workspace) python scripts/上传_file.py https://example.com ./test.xlsx
# Workspace-relative python scripts/上传_file.py https://example.com workspace/data/test.xlsx
# With 环境 variable python scripts/上传_file.py https://example.com ${HOME}/下载s/file.xlsx
Common Selectors Selector Description #filePicker Common id for file 输入s [type=file] Any file 输入 element 输入[type=file] Explicit file 输入 .上传-zone Drop zone contAIners Troubleshooting
File 输入 not found:
运行 代理-browser snapshot to inspect page elements Look for [type=file] or file-related buttons Try 命令行工具cking the 上传 zone first
上传 fAIls:
Ensure file path is absolute 检查 file exists: test-path Try 代理-browser find text 选择文件 命令行工具ck first
Page not loaded:
添加 代理-browser wAIt 2000 after open Use 代理-browser wAIt --load networkidle for slow pages Related Commands # Inspect page elements 代理-browser snapshot
# Take screenshot 代理-browser screenshot
# Find elements by text 代理-browser find text "上传"
# 命令行工具ck element 代理-browser 命令行工具ck
# 上传 file 代理-browser 上传
Example: 上传 Excel to UU 工具 # Method 1: Direct 代理-browser commands 代理-browser open https://uu工具.cn/excel/ 代理-browser wAIt 2000 代理-browser find text 选择文件 命令行工具ck 代理-browser 上传 "#filePicker" C:\Users\陈\.OpenClaw\workspace\test.xlsx
# Method 2: Using Python script with absolute path python scripts/上传_file.py https://uu工具.cn/excel/ C:\Users\陈\.OpenClaw\workspace\test.xlsx
# Method 3: Using Python script with workspace-relative path python scripts/上传_file.py https://uu工具.cn/excel/ workspace/test.xlsx
# Method 4: Using Python script with custom selector and wAIt time python scripts/上传_file.py https://uu工具.cn/excel/ workspace/test.xlsx "#filePicker" 3000