Skip to content
/ htql Public

HTQL is a SQL like query language for extracting data from html structures. It is designed to be simple and easy to use within other sql adapters.

Notifications You must be signed in to change notification settings

AICDEV/htql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

HTQL (Hyper Text Query Language)

HTQL is a SQL-like query language designed for extracting data from HTML structures. Its syntax is simple and intuitive, making it easy to use within other SQL adapters or applications.

Table of Contents

Introduction

HTQL allows users to extract structured data from HTML documents using familiar SQL syntax. With HTQL, you can select elements by type, apply filters, and even pull data from remote URLs, providing a powerful way to query HTML content in a standardized format.

Usage Examples

Basic Select

Use the SELECT statement to query HTML structures. Examples:

SELECT * FROM ./test.html                     -- Select all elements from a local file
SELECT p, div, h2 FROM ./test.html             -- Select specific elements (p, div, h2)
SELECT * FROM ./test.html WHERE attributes.class = 'title'
SELECT * FROM ./test.html WHERE attributes IS NOT NULL
SELECT * FROM ./test.html WHERE attributes.class = 'title' OR attributes.id = 'content'
SELECT span FROM ./test.html WHERE attributes.class = 'title' AND attributes.id = 'content'
SELECT span FROM ./test.html WHERE attributes.class = 'title' AND NOT attributes.id = 'content'

Select from Remote URL

You can also query data directly from remote HTML documents by specifying the URL:

SELECT p, div, h2 FROM https://example.com

About

HTQL is a SQL like query language for extracting data from html structures. It is designed to be simple and easy to use within other sql adapters.

Resources

Stars

Watchers

Forks

Packages

No packages published