返回顶部
a

agentqlAgentQL网页抓取

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
安全检测
已通过
97
下载量
免费
免费
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.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部