Jinri Toutiao Keyword Collector
Feature Overview
This skill uses browser automation to access Jinri Toutiao (www.toutiao.com), simulates user behavior of entering keywords in the search box, and automatically collects the relevant keyword suggestions displayed in the search dropdown.
Trigger Conditions
Trigger this skill when the user mentions any of the following keywords:
- - 今日头条关键词
- 收集头条关键词
- 头条搜索建议
- 头条热门词
- 头条 SEO
- 头条话题
- Jinri Toutiao keywords
- Collect Toutiao keywords
- Toutiao search suggestions
- Toutiao trending keywords
- Toutiao SEO
- Toutiao topics
Use Cases
- - SEO keyword research and optimization
- Content creation inspiration gathering
- Trending topic discovery
- Competitor keyword analysis
- Market research and trend analysis
Operation Workflow
1. Launch Browser
Use the browser tool to launch the browser:
CODEBLOCK0
2. Access Jinri Toutiao Homepage
Navigate to Jinri Toutiao:
CODEBLOCK1
Wait for the page to fully load.
3. Get Page Snapshot
Use snapshot to get the page element structure and locate the search box:
CODEBLOCK2
Search for the search box element in the snapshot results (typically an input element containing keywords like "search").
4. Input Keywords
Use the act tool to input keywords into the search box:
CODEBLOCK3
Set slowly: true to ensure the page can properly trigger the auto-suggest functionality.
5. Wait for Suggestion Dropdown
After input is complete, wait 1-2 seconds for the auto-suggest dropdown to load:
CODEBLOCK4
6. Get Dropdown Snapshot
Take another page snapshot, this time capturing the keyword list in the auto-suggest dropdown:
CODEBLOCK5
7. Extract Keywords
Extract all keyword text from the snapshot results within the suggestion dropdown. The dropdown typically contains multiple option, li, or div elements, each containing a suggested keyword.
8. Output Format
CODEBLOCK6
9. Cleanup (Optional)
If the user has no further requests, close the browser:
CODEBLOCK7
Important Notes
- 1. Network Latency: Jinri Toutiao page loading may take time; ensure sufficient waiting time before operations
- Element Locating: Using
refs: aria provides more stable element references - Input Speed: Setting
slowly: true ensures the page can properly trigger auto-suggest - Anti-scraping Mechanisms: Avoid frequent requests in a short period; it is recommended to wait 5-10 seconds between multiple collections
- Session Persistence: For multiple collections, keep the browser session open to improve efficiency
Batch Collection for Multiple Keywords
To collect suggestions for multiple keywords:
- 1. Keep the browser session open
- Repeat steps 4-7 for each keyword
- Use
act with kind: type to clear the search box before entering a new keyword - Compile all results into a summary report
Troubleshooting
Search Box Not Found
- - Check if the page has fully loaded
- Try refreshing the page and retrying
- Use a more detailed snapshot (add the
depth parameter)
Suggestion Dropdown Does Not Appear
- - Ensure input speed is slow enough (
slowly: true) - Increase wait time (
timeMs: 3000 or longer) - Check if the network connection is normal
Keyword List is Empty
- - Verify the input keyword is valid
- Try testing with common keywords
- Check if Jinri Toutiao has updated its page structure
Reference Resources
- - Browser Automation Best Practices: See INLINECODE14
- Jinri Toutiao Page Structure Description: See INLINECODE15
今日头条关键词收集器
功能概述
该技能通过浏览器自动化访问今日头条(www.toutiao.com),模拟用户在搜索框中输入关键词的行为,并自动收集搜索下拉框中显示的相关关键词建议。
触发条件
当用户提及以下任一关键词时触发该技能:
- - 今日头条关键词
- 收集头条关键词
- 头条搜索建议
- 头条热门词
- 头条 SEO
- 头条话题
- Jinri Toutiao keywords
- Collect Toutiao keywords
- Toutiao search suggestions
- Toutiao trending keywords
- Toutiao SEO
- Toutiao topics
使用场景
- - SEO关键词研究与优化
- 内容创作灵感收集
- 热门话题发现
- 竞争对手关键词分析
- 市场研究与趋势分析
操作流程
1. 启动浏览器
使用 browser 工具启动浏览器:
action: start
profile: openclaw
2. 访问今日头条首页
导航至今日头条:
action: navigate
targetUrl: https://www.toutiao.com
等待页面完全加载。
3. 获取页面快照
使用 snapshot 获取页面元素结构并定位搜索框:
action: snapshot
refs: aria
在快照结果中搜索搜索框元素(通常为包含搜索等关键词的 input 元素)。
4. 输入关键词
使用 act 工具在搜索框中输入关键词:
action: act
ref: <搜索框的 ref 值>
kind: type
text: <用户提供的关键词>
slowly: true
设置 slowly: true 以确保页面能正常触发自动建议功能。
5. 等待建议下拉框
输入完成后,等待1-2秒让自动建议下拉框加载:
action: act
kind: wait
timeMs: 2000
6. 获取下拉框快照
再次获取页面快照,这次捕获自动建议下拉框中的关键词列表:
action: snapshot
refs: aria
7. 提取关键词
从快照结果中提取建议下拉框内的所有关键词文本。下拉框通常包含多个 option、li 或 div 元素,每个元素包含一个建议关键词。
8. 输出格式
关键词:[输入的关键词]
搜索建议:
- 1. 建议1
- 建议2
- 建议3
...
9. 清理(可选)
如果用户没有进一步请求,关闭浏览器:
action: close
重要提示
- 1. 网络延迟:今日头条页面加载可能需要时间,确保操作前有足够的等待时间
- 元素定位:使用 refs: aria 可获得更稳定的元素引用
- 输入速度:设置 slowly: true 确保页面能正常触发自动建议
- 反爬机制:避免短时间内频繁请求,多次收集之间建议等待5-10秒
- 会话保持:如需多次收集,保持浏览器会话打开以提高效率
多关键词批量收集
如需收集多个关键词的建议:
- 1. 保持浏览器会话打开
- 对每个关键词重复步骤4-7
- 使用 act 的 kind: type 在输入新关键词前清空搜索框
- 将所有结果整理成汇总报告
故障排除
搜索框未找到
- - 检查页面是否完全加载
- 尝试刷新页面并重试
- 使用更详细的快照(添加 depth 参数)
建议下拉框未出现
- - 确保输入速度足够慢(slowly: true)
- 增加等待时间(timeMs: 3000 或更长)
- 检查网络连接是否正常
关键词列表为空
- - 验证输入的关键词是否有效
- 尝试使用常见关键词进行测试
- 检查今日头条是否更新了页面结构
参考资源
- - 浏览器自动化最佳实践:参见 references/browser-automation-best-practices.md
- 今日头条页面结构说明:参见 references/toutiao-structure.md