Skip to content

KtSoup

Maven Central Sonatype Nexus (Snapshots) codecov

A Kotlin Multiplatform HTML5 parsing library built on Lexbor, Jsoup, and node-html-parser.

API Docs

Checkout the Getting Started guide.

val html = """
<html>
    <body>
        <div id="test" class="test">Hello World</div>
    </body>
</html>
"""

KtSoupParser.parse(html).use { document ->
    val div = document.querySelector("#test")
    println(div.textContent()) // Hello World
    println(div.html())        // <div id="test" class="test">Hello World</div>
    println(div.className())   // test
}