Goal
Use the user's local real Chrome TikTok login state to complete content research, creator search, video sampling, profile collection, and screenshot evidence. By default, only read public or user-visible pages; do not like, follow, comment, send direct messages, publish, or modify account settings.
Prerequisites
Choose one control path:
- WebBridge: local WebBridge daemon and browser extension are available.
- Chrome/CDP: the user starts Chrome with remote debugging themselves, and the script connects via Playwright.
- Apple Events: after enabling
View > Developer > Allow JavaScript from Apple Eventson macOS Chrome, usescripts/tk_real_chrome.py。 - Manual assistance: when login, CAPTCHA, region pop-up, or risk control appears, have the user handle it in real Chrome and then continue.
WebBridge health check:
WEBBRIDGE_URL="${WEBBRIDGE_URL:-http://127.0.0.1:10086}"
curl -s "$WEBBRIDGE_URL/status"
CDP health check:
python3 <skill-dir>/scripts/tk_research.py check-cdp
Workflow
- Determine task type:
- Keyword video search →
search - Keyword creator search →
authors - Existing creator profile →
creator - The user has already navigated Chrome to the target page →
current
- Keyword video search →
- Operate Chrome:
navigateOpen the TikTok search page/creator page.fillEnter the search term,clicktrigger the search.snapshotRead the page content and locate video cards.evaluateExtract structured data (URL, author, title, engagement counts).- Take screenshots for evidence, and avoid pasting base64 screenshots directly into the context.
- Scroll to load more and repeat extraction.
- Save results:
- Write structured data to
collected_items.json。 - Save screenshots to
screenshots/。 - Generate
research_notes.mdfor business distillation.
- Write structured data to
- Follow-up handoff:
- To download videos → hand off to
bggg-tiktok-downloader - To analyze videos → hand off to
bggg-tiktok-readvideo
- To download videos → hand off to
WebBridge operation examples
1. Open TikTok and search for keywords
# 打开 TikTok 首页(新标签页,session 隔离)
curl -s -X POST "$WEBBRIDGE_URL/command" \
-H 'Content-Type: application/json' \
-d '{"action":"navigate","args":{"url":"https://www.tiktok.com","newTab":true,"group_title":"TikTok Research"},"session":"tiktok-search"}'
# 获取页面 snapshot,找到搜索框的 @e ref
curl -s -X POST "$WEBBRIDGE_URL/command" \
-d '{"action":"snapshot","session":"tiktok-search"}'
# 在搜索框填入关键词(用 @e ref 或 CSS selector)
curl -s -X POST "$WEBBRIDGE_URL/command" \
-d '{"action":"fill","args":{"selector":"input[type=search]","value":"skincare routine"},"session":"tiktok-search"}'
# 点击搜索按钮或按回车
curl -s -X POST "$WEBBRIDGE_URL/command" \
-d '{"action":"click","args":{"selector":"button[type=submit]"},"session":"tiktok-search"}'
2. Extract video card data
# 用 evaluate 提取视频列表的结构化数据
curl -s -X POST "$WEBBRIDGE_URL/command" \
-d '{"action":"evaluate","args":{"code":"(() => { const cards = [...document.querySelectorAll(\"[data-e2e=search-card-video]\")].slice(0, 10); return cards.map((c, i) => { const link = c.querySelector(\"a\"); const author = c.querySelector(\"[data-e2e=search-card-user-avatar]\"); const metrics = [...c.querySelectorAll(\"[data-e2e=video-views]\")]; return { index: i, url: link ? link.href : null, title: c.innerText.slice(0, 200), author: author ? author.getAttribute(\"href\") : null, raw_text: c.innerText.slice(0, 500) }; }); })()"},"session":"tiktok-search"}'
TikTok DOM changes frequently; the selectors above are only examples. In actual use, first use
snapshotto read the current page structure, then write the correspondingevaluateextraction logic.
3. Screenshot evidence
python3 <skill-dir>/scripts/tk_research.py screenshot "search_001"
4. Scroll to load more
curl -s -X POST "$WEBBRIDGE_URL/command" \
-d '{"action":"evaluate","args":{"code":"window.scrollTo(0, document.body.scrollHeight); return document.body.scrollHeight;"},"session":"tiktok-search"}'
After scrolling, wait 2-3 seconds for content to load, then snapshot or evaluate to extract newly appearing cards.
5. Open a creator profile to collect works
# 导航到博主主页
curl -s -X POST "$WEBBRIDGE_URL/command" \
-d '{"action":"navigate","args":{"url":"https://www.tiktok.com/@creator","newTab":true},"session":"tiktok-creator"}'
# 提取主页视频列表
curl -s -X POST "$WEBBRIDGE_URL/command" \
-d '{"action":"evaluate","args":{"code":"(() => { const items = [...document.querySelectorAll(\"[data-e2e=user-post-item]\")].slice(0, 10); return items.map((item, i) => { const link = item.querySelector(\"a\"); const views = item.querySelector(\"[data-e2e=video-views]\"); return { index: i, url: link ? link.href : null, title: item.innerText.slice(0, 100), views: views ? views.innerText : null, raw_text: item.innerText.slice(0, 300) }; }); })()"},"session":"tiktok-creator"}'
Output directory structure
bggg-tiktok-search/projects/tiktok-research/YYYYMMDD_HHMMSS_<slug>/
├── collected_items.json
├── research_notes.md
└── screenshots/
├── search_001.png
├── search_002.png
└── ...
collected_items.json structure
{
"method": "kimi-webbridge",
"query": "skincare routine",
"source_url": "https://www.tiktok.com/search?q=skincare%20routine",
"session": "tiktok-search",
"items": [
{
"url": "https://www.tiktok.com/@creator/video/1234567890123456789",
"author": "@creator",
"author_url": "https://www.tiktok.com/@creator",
"title": "visible caption or card text",
"metric_1": "visible metric",
"metric_2": "visible metric",
"date": "visible date",
"raw_text": "short visible evidence",
"screenshot": "screenshots/search_001.png",
"notes": "why this item matters"
}
]
}
Research output suggestions
When finally replying to the user, prioritize giving:
- Research package paths: JSON, CSV, Markdown, screenshots.
- List of highest-value candidate videos or creators.
- Content structure insights: topic selection, opening hooks, account positioning, sales intent, shot/script patterns.
- Next-step suggestions: whether to proceed to download, transcription, deep analysis, or Feishu Bitable archival.
Notes
- TikTok DOM changes frequently,
evaluateThe selector in it needs to be adjusted according to the actual page structure. First usesnapshotto confirm the current structure before writing the extraction logic. - When encountering login, risk control, regional restrictions, or CAPTCHA, have the user handle it manually in a real Chrome and then continue. Do not solve CAPTCHAs on their behalf.
- Do not perform external side-effect actions such as liking, following, commenting, sending direct messages, posting, or changing account settings; if the user explicitly requests it, confirmation must be obtained before the action.
- Do not submit cookies, browser profiles, screenshots, CSV, JSON scraping results, or any runtime artifacts to a public repository.
- Write screenshot files to
projects/tiktok-research/.../screenshots/; do not paste base64 screenshots directly into the context. - Close the session after the task ends:
curl -s -X POST "$WEBBRIDGE_URL/command" \ -d '{"action":"close_session","session":"tiktok-search"}' references/implementation-notes.mdrecords design patterns learned from other browser-use skills; third-party reference projects are not vendored with this skill.
Read more implementation details as needed from references/implementation-notes.md。