Aug 03, 2022
sqlite-html is a new SQLite extension for querying, manipulating, and generating HTML.
sqlite-htmlis an alternative to other HTML parsers like htmlq, BeautifulSoup, and Cheerio, with the added benefit of a full SQL API. Simply load the extension in your SQLite client of choice, and start parsing HTML with CSS selectors.
truly brilliant. Example:
select html_text(items.html, "strong") as name, html_attr_get( html_extract(items.html, 'a[href*=".zip"]'), 'a', 'href' ) as href from html_each( (select page from pages where name = 'lacounty-results'), '.expandable_item.indent' ) as items
It would be interesting to try replacing my beautiful soup scripts in NBA Stats with this tool.
Built in golang, with goquery (library for html selectors) and riyaz-ali/sqlite (library for building sqlite extensions in go)