mirror of
https://github.com/mihonapp/mihon.git
synced 2024-10-31 21:20:59 -04:00
13 lines
333 B
Kotlin
13 lines
333 B
Kotlin
|
package eu.kanade.tachiyomi.util
|
||
|
|
||
|
import org.jsoup.nodes.Element
|
||
|
|
||
|
fun Element.selectText(css: String, defaultValue: String? = null): String? {
|
||
|
return select(css).first()?.text() ?: defaultValue
|
||
|
}
|
||
|
|
||
|
fun Element.selectInt(css: String, defaultValue: Int = 0): Int {
|
||
|
return select(css).first()?.text()?.toInt() ?: defaultValue
|
||
|
}
|
||
|
|