|
|
@ -25,16 +25,10 @@ class AnalyzeByJSoup { |
|
|
|
private lateinit var element: Element |
|
|
|
private lateinit var element: Element |
|
|
|
|
|
|
|
|
|
|
|
fun parse(doc: Any): AnalyzeByJSoup { |
|
|
|
fun parse(doc: Any): AnalyzeByJSoup { |
|
|
|
element = if (doc is Element) { |
|
|
|
element = when (doc) { |
|
|
|
doc |
|
|
|
is Element -> doc |
|
|
|
} else if (doc is JXNode) { |
|
|
|
is JXNode -> if (doc.isElement) doc.asElement() else Jsoup.parse(doc.toString()) |
|
|
|
if (doc.isElement) { |
|
|
|
else -> Jsoup.parse(doc.toString()) |
|
|
|
doc.asElement() |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
Jsoup.parse(doc.value().toString()) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
Jsoup.parse(doc.toString()) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return this |
|
|
|
return this |
|
|
|
} |
|
|
|
} |
|
|
|