SF Scraper — SuccessFactors Browser Scraping Skill
Scrape employee data from a live, logged-in SAP SuccessFactors session via browser automation.
Prerequisites
- - User must have SAP SuccessFactors open and logged in on a Chrome tab.
- OpenClaw Browser Relay Chrome extension must be active (badge ON) on that tab.
- Use
profile="chrome" for all browser calls.
Workflow
1. Discover the SuccessFactors Base URL
Take a snapshot of the attached Chrome tab to identify the current SF domain:
CODEBLOCK0
Extract the base URL (e.g., https://<company>.successfactors.com or https://pmsalesdemo8.successfactors.com).
2. Navigate to Employee Search / People Profile
SuccessFactors supports deep-link URLs. Use the following pattern to go directly to an employee's profile:
Primary pattern (People Profile / Live Profile):
CODEBLOCK1
Fallback patterns if primary doesn't work:
CODEBLOCK2
Navigate using:
CODEBLOCK3
Wait briefly for the page to load, then snapshot.
3. If Deep Link Fails — Use Search
If the deep link lands on a generic page or errors, fall back to the global search:
- 1. Snapshot the page to find the search bar (usually top-right, role:
searchbox or textbox with name containing "Search"). - Click the search box, type the employee ID, press Enter.
- Snapshot results, click the matching employee profile link.
4. Scrape Employee Data
Once on the profile page, take a snapshot:
CODEBLOCK4
Extract the following fields from the rendered accessibility tree:
| Field | Where to Look |
|---|
| Name | Page heading / heading role, or prominent text near avatar |
| Employee ID |
Usually in a details section or the URL itself |
|
Email | Look for
link with mailto: or text containing @ |
|
Job Title | Near name, often under heading |
|
Department | In profile details / info card |
|
Manager | In profile details, often a clickable link |
|
Location | In profile details section |
|
Phone | In contact info section |
Not all fields will always be visible — return what's available.
5. If Profile Page Uses Tabs/Sections
SuccessFactors profiles often have tabs (Personal Info, Employment Info, Job Info, etc.). If needed data isn't visible:
- 1. Snapshot to find tab elements.
- Click the relevant tab (e.g., "Personal Information", "Job Information", "Employment Details").
- Snapshot again and extract.
6. Return Results
Format results clearly:
CODEBLOCK5
Only include fields that were actually found on the page. Do not guess or fabricate data.
Configuration
The user should create a config in TOOLS.md or the workspace with:
CODEBLOCK6
If no base URL is configured, discover it from the currently open tab.
Error Handling
- - Not logged in: If snapshot shows a login page, tell the user to log in first.
- Access denied / no profile found: Report clearly — the user may lack permissions for that employee.
- Page timeout: Retry snapshot once after 3 seconds. If still loading, inform the user.
- Search returns multiple results: List them and ask the user to clarify.
Batch Mode
If user provides multiple employee IDs, iterate through each one sequentially using the same workflow. Collect results and present as a table.
Important Notes
- - Never use OData API, REST endpoints, or any programmatic API. This skill is purely browser-based scraping.
- Always use
profile="chrome" — never profile="openclaw" (we need the user's authenticated session). - Be patient with page loads — SF can be slow. Use snapshots to verify page state before extracting.
- Respect the user's session — don't navigate away from SF without warning.
SF Scraper — 基于浏览器自动化的SuccessFactors数据抓取技能
通过浏览器自动化,从已登录的SAP SuccessFactors会话中抓取员工数据。
前置条件
- - 用户必须在Chrome浏览器标签页中打开并登录SAP SuccessFactors。
- 该标签页上的OpenClaw Browser Relay Chrome扩展必须处于激活状态(徽章显示为ON)。
- 所有浏览器调用均使用profile=chrome。
工作流程
1. 发现SuccessFactors基础URL
对当前Chrome标签页进行截图,以识别当前的SF域名:
browser(action=snapshot, profile=chrome, compact=true)
提取基础URL(例如:https://<公司名称>.successfactors.com 或 https://pmsalesdemo8.successfactors.com)。
2. 导航至员工搜索/人员档案
SuccessFactors支持深度链接URL。使用以下模式直接跳转到员工档案:
主要模式(人员档案/实时档案):
{baseurl}/sf/liveprofile?selecteduser={员工ID}
主要模式无效时的备用模式:
{baseurl}/xi/ui/peopleprofile/pages/index.xhtml?selecteduser={员工ID}
{baseurl}/sf/home?selecteduser={员工ID}
使用以下方式导航:
browser(action=navigate, profile=chrome, targetUrl={构造的URL})
稍等页面加载,然后截图。
3. 如果深度链接失败 — 使用搜索功能
如果深度链接跳转到通用页面或报错,则回退到全局搜索:
- 1. 截图页面以查找搜索栏(通常在右上角,角色为searchbox或包含Search名称的textbox)。
- 点击搜索框,输入员工ID,按回车键。
- 截图搜索结果,点击匹配的员工档案链接。
4. 抓取员工数据
进入档案页面后,进行截图:
browser(action=snapshot, profile=chrome, compact=true)
从渲染的可访问性树中提取以下字段:
| 字段 | 查找位置 |
|---|
| 姓名 | 页面标题 / heading角色,或头像附近的显著文本 |
| 员工ID |
通常在详细信息区域或URL本身 |
|
邮箱 | 查找包含mailto:的link或包含@的文本 |
|
职位 | 姓名附近,通常在标题下方 |
|
部门 | 在档案详情/信息卡片中 |
|
经理 | 在档案详情中,通常为可点击的链接 |
|
工作地点 | 在档案详情区域 |
|
电话 | 在联系信息区域 |
并非所有字段都会始终可见 — 返回可获取的内容。
5. 如果档案页面使用标签页/分区
SuccessFactors档案通常包含标签页(个人信息、雇佣信息、工作信息等)。如果所需数据不可见:
- 1. 截图以查找标签页元素。
- 点击相关标签页(例如个人信息、工作信息、雇佣详情)。
- 再次截图并提取数据。
6. 返回结果
清晰格式化结果:
员工:张三
ID:12345
邮箱:zhangsan@company.com
职位:高级开发工程师
部门:工程部
经理:李四
工作地点:印度班加罗尔
仅包含页面上实际找到的字段。不要猜测或编造数据。
配置
用户应在TOOLS.md或工作空间中创建配置:
markdown
SuccessFactors
- - 基础URL:https://yourcompany.successfactors.com
如果未配置基础URL,则从当前打开的标签页中自动发现。
错误处理
- - 未登录:如果截图显示登录页面,告知用户先登录。
- 访问被拒绝/未找到档案:清晰报告 — 用户可能对该员工没有权限。
- 页面超时:等待3秒后重试截图一次。如果仍在加载,告知用户。
- 搜索返回多个结果:列出结果并请用户确认。
批量模式
如果用户提供多个员工ID,使用相同工作流程依次遍历每个ID。收集结果并以表格形式呈现。
重要说明
- - 切勿使用OData API、REST端点或任何程序化API。 此技能纯粹基于浏览器抓取。
- 始终使用profile=chrome — 切勿使用profile=openclaw(我们需要用户的已认证会话)。
- 对页面加载保持耐心 — SF可能较慢。在提取数据前使用截图验证页面状态。
- 尊重用户的会话 — 未经警告不要导航离开SF。