beautifulparser

Simple parser for HTML

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version 0.1.6
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:26

Tags

Authors

  • TelegramXPlus

Installation

nimble install beautifulparser
choosenim install beautifulparser
git clone https://github.com/TelegramXPlus/beautifulparser

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
beautifulparser - - - - - - -

Dependencies

Package Version Optional
nim >= 1.0.0 No

README

beautifulparser

Test

beautifulparser is a (very) simple library for parsing HTML documents inspired by beautifulsoup4

Getting Started

nimble install beautifulparser

Usage

import std/htmlparser # to use loadHtml/parseHtml procedures
import beautifulparser


let html = loadHtml("input.html") # or parseHtml("<h1>Your html</h1>")

for i in html.findAllNodes("span", {"class": "my-custom-class"}):
  echo i.innerText

Using tables

You can also use tables instead of arrays of tuples of strings (lol)

import std/[htmlparser, tables]
import beautifulparser


let html = loadHtml("input.html")

for i in html.findAllNodes("span", {"class": "my-custom-class"}.toTable()):
  echo i.innerText

Get the first element

import std/htmlparser
import beautifulparser


let html = loadHtml("input.html")

let mySpan = html.findNode("span", {"class", "my-custom-class"})

if mySpan.isSome():
  # implement your logic