Home
Softono

KtSoup

Open source Apache-2.0 Kotlin
36
Stars
0
Forks
15
Issues
1
Watchers
3 months
Last Commit

 About KtSoup

A Kotlin multiplatform HTML5 parsing library

Platforms

Web Self-hosted Android

Languages

Kotlin

Need Help Installing KtSoup?

We provide expert installation service for this software. Our team will install, configure, and secure KtSoup on your server. plans start at just $30.

KtSoup

Maven Central codecov

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

Documentation

API Docs

Usage

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

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

Download

Maven Central Sonatype Nexus (Snapshots)

repositories {
    mavenCentral()
    // Or snapshots
    maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
}

dependencies {
    implementation("org.drewcarlson:ktsoup-core:$VERSION")
    implementation("org.drewcarlson:ktsoup-fs:$VERSION")
    implementation("org.drewcarlson:ktsoup-ktor:$VERSION")
}
Toml (Click to expand)
[versions]
ktsoup = "1.0.0-SNAPSHOT"

[libraries]
ktsoup-core = { module = "org.drewcarlson:ktsoup-core", version.ref = "ktsoup" }
ktsoup-fs = { module = "org.drewcarlson:ktsoup-fs", version.ref = "ktsoup" }
ktsoup-ktor = { module = "org.drewcarlson:ktsoup-ktor", version.ref = "ktsoup" }

License

This project is licensed under Apache-2.0, found in LICENSE.