Binance square scraper

From itgoyo/hermes-skills · View interactive version

Binance square scraper is an AI agent skill from the GitHub repository itgoyo/hermes-skills. 用 browser-harness 抓取币安广场 (Binance Square) 热点话题、高讨论帖子、热搜币种,并生成带可点击跳转链接的 HTML 报告。

How to use this skill

Skill file

Binance Square 热点抓取

触发条件

用户要求抓取币安广场热点、热门帖子、讨论度排名等。

关键发现(字段测试得出)

URL 结构

帖子原文:  https://www.binance.com/zh-CN/square/post/{postId}
话题页:    https://www.binance.com/zh-CN/square/hashtag/{encodedTopic}
用户主页:  https://www.binance.com/zh-CN/square/profile/{handle}
恐惧贪婪:  https://www.binance.com/zh-CN/square/fear-and-greed-index
热门话题:  https://www.binance.com/zh-CN/square/trends
交易对:    https://www.binance.com/zh-CN/trade/{COIN}_USDT
合约:      https://www.binance.com/zh-CN/futures/{COIN}USDT

抓取步骤

# Step 1: 导航并等待渲染
new_tab("https://www.binance.com/zh-CN/square")
time.sleep(8)

# Step 2: 用 cdp Runtime.evaluate 提取文本
text = cdp("Runtime.evaluate",
    expression="document.body.innerText.substring(0, 5000)",
    returnByValue=True)
content = text['result']['value']

# Step 3: 提取所有链接(含帖子/话题/交易对)
links_raw = cdp("Runtime.evaluate", expression="""
(function() {
    const links = [];
    document.querySelectorAll('a').forEach(a => {
        if (a.href && a.href.length > 10) {
            links.push({href: a.href, text: (a.innerText || '').trim().substring(0, 80)});
        }
    });
    return JSON.stringify(links.slice(0, 60));
})()
""", returnByValue=True)
links = json.loads(links_raw['result']['value'])

# Step 4: 滚动获取更多帖子
cdp("Runtime.evaluate", expression="window.scrollBy(0, 2000)", returnByValue=True)
time.sleep(3)
# 再次抓取链接...

数据分类

从 innerText 中可提取:

从链接列表中可提取:

输出要求(用户偏好)

输出 HTML 报告,保存到 ~/Documents/Hermes/,要求:

坑

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.