通过浏览器自动化技术,实时抓取微博平台各分类下的热门搜索词条。支持实时、生活、文娱、社会四大分类。
from openclaw import WebSearch
# 获取微博生活类热搜
search = WebSearch()
result = search.query("weibo hot search life category")
print(result)
系统会自动识别关键词并调用对应的 URL:
from weibo_hot_search import get_weibo_hot_search
# 获取生活类热搜
result = get_weibo_hot_search("https://s.weibo.com/top/summary?cate=life")
print(result)
{
"code": 200,
"message": "成功",
"data": [
{
"title": "热搜词条名称",
"hot": "12345678"
},
...
]
}
import json
# 完整使用流程
if __name__ == "__main__":
url = "https://s.weibo.com/top/summary?cate=life" # 生活分类
result = get_weibo_hot_search(url, headless=True)
print(json.dumps(result, ensure_ascii=False, indent=2))
技能文件位于:C:\Users\Administrator\.openclaw\workspace\skills\web-hot-search\
包含文件:
SKILL.md - 技能文档(本文档)scripts/weibo_hot_search.py - 核心 Python 脚本README.md - 使用说明版本: v1.0
更新日期: 2026-03-27
维护者: Kimi (金米) 📈
共 1 个版本