闲社服务运行正常AI智能体自动化平台
a

AgentQL网页抓取

技能标识:agentql

Web scraping and browser automation using AgentQL — query any webpage with natural language to extract structured data, interact with elements, and automate browser tasks. Use when asked to scrape, extract data from, or automate interactions on a webpage using natural language queries.

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 1.0.0
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

AgentQL网页抓取

AgentQL 技能

AgentQL 允许您使用自然语言查询网页,以提取结构化数据并自动化浏览器交互。它在底层使用 Playwright。

设置

AgentQL 需要一个 API 密钥。将其设置为环境变量:
bash
export AGENTQLAPIKEY=your-api-key

在 https://dev.agentql.com 获取免费 API 密钥

快速入门(Python)

python
import agentql
from playwright.syncapi import syncplaywright

with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
page = agentql.wrap(browser.new_page())

page.goto(https://example.com)

# 使用自然语言查询
response = page.query_data(
{
title
main_heading
description
}
)

print(response)
browser.close()

编写并运行脚本

bash

创建新的脚本模板


agentql new-script scraper.py

运行它

python3 scraper.py

常见模式

提取结构化数据

python response = page.query_data( { products[] { name price rating } } )

与元素交互

python response = page.query_elements( { search_box submit_button } ) response.search_box.fill(query) response.submit_button.click()

无头抓取

python browser = p.chromium.launch(headless=True)

使用现有页面(连接到正在运行的浏览器)

python browser = p.chromium.connectovercdp(http://127.0.0.1:9222) # Brave/Chrome page = agentql.wrap(browser.contexts[0].pages[0])

命令行工具

bash agentql doctor # 检查设置 agentql new-script # 生成模板脚本

注意事项

  • - 需要 API 密钥:https://dev.agentql.com(提供免费套餐)
  • 通过以下命令运行脚本:python3 script.py
  • 可以通过 CDP(端口 9222)连接到正在运行的 Brave 浏览器

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 agentql-1776014612 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 agentql-1776014612 技能

通过命令行安装

skillhub install agentql-1776014612

下载

⬇ 下载 agentql v1.0.0(免费)

文件大小: 1.51 KB | 发布时间: 2026-4-13 09:12

v1.0.0 最新 2026-4-13 09:12
Initial release of agentql

- Enables web scraping and browser automation using natural language queries.
- Extract structured data and interact with webpage elements via AgentQL.
- Integrates with Playwright for browser control.
- Provides Python and CLI quick start instructions.
- Requires a free API key from https://dev.agentql.com.
返回顶部