Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drewcarlson/ktsoup
A Kotlin multiplatform HTML5 parsing library
https://github.com/drewcarlson/ktsoup
jsoup kotlin kotlin-multiplatform lexbor web-scraping
Last synced: 26 days ago
JSON representation
A Kotlin multiplatform HTML5 parsing library
- Host: GitHub
- URL: https://github.com/drewcarlson/ktsoup
- Owner: DrewCarlson
- License: apache-2.0
- Created: 2023-07-30T08:03:47.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-18T23:56:30.000Z (about 1 month ago)
- Last Synced: 2024-12-19T00:29:18.199Z (about 1 month ago)
- Topics: jsoup, kotlin, kotlin-multiplatform, lexbor, web-scraping
- Language: Kotlin
- Homepage: https://drewcarlson.github.io/KtSoup/latest/
- Size: 1.73 MB
- Stars: 34
- Watchers: 2
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# KtSoup
![Maven Central](https://img.shields.io/maven-central/v/org.drewcarlson/ktsoup-core-jvm?label=maven&color=blue)
![](https://github.com/DrewCarlson/KtSoup/workflows/Tests/badge.svg)
[![codecov](https://codecov.io/gh/DrewCarlson/KtSoup/branch/main/graph/badge.svg?token=BTQ8XQOD86)](https://codecov.io/gh/DrewCarlson/KtSoup)A multiplatform HTML5 parsing library built on [Lexbor](https://github.com/lexbor/lexbor), [Jsoup](https://jsoup.org/), and [node-html-parser](https://github.com/taoqf/node-html-parser).
### [Documentation](https://drewcarlson.github.io/KtSoup/latest/)
### [API Docs](https://drewcarlson.github.io/KtSoup/latest/kdoc/)## Usage
```kotlin
val documentString = """
Hello World
"""
val document = KtSoupParser.parse(documentString)
document.use { document ->
val div = document.querySelector("#test")
println(div.textContent()) // Hello World
println(div.html()) //Hello World
}```
## Download
[![Maven Central](https://img.shields.io/maven-central/v/org.drewcarlson/ktsoup-core-jvm?label=maven&color=blue)](https://search.maven.org/search?q=g:org.drewcarlson%20a:ktsoup-*)
![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/org.drewcarlson/ktsoup-core-jvm?server=https%3A%2F%2Fs01.oss.sonatype.org)![](https://img.shields.io/static/v1?label=&message=Platforms&color=grey)
![](https://img.shields.io/static/v1?label=&message=Js&color=blue)
![](https://img.shields.io/static/v1?label=&message=Jvm&color=blue)
![](https://img.shields.io/static/v1?label=&message=Linux&color=blue)
![](https://img.shields.io/static/v1?label=&message=macOS&color=blue)
![](https://img.shields.io/static/v1?label=&message=Windows&color=blue)
![](https://img.shields.io/static/v1?label=&message=iOS&color=blue)```kotlin
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)
```toml
[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](LICENSE).