find

abstract fun find(scope: CoroutineScope, rootXpath: String, predicate: (CoroutineScope, String) -> Deferred<Boolean>): Deferred<String?>

递归查找 rootXpath 下首个满足 predicate 的节点(深度优先)。

Return

第一个匹配元素的 XPath,未找到则返回空字符串 ""

Parameters

scope

协程作用域

rootXpath

搜索起点 XPath

predicate

判定逻辑,接收 CoroutineScope 和候选元素的 XPath,返回是否匹配