getAttribute

abstract fun getAttribute(scope: CoroutineScope, xpath: String, attributeName: String): Deferred<String?>

异步获取由XPath指定的元素的某个HTML属性值 (Attribute)。

Return

一个 Deferred<String?>,解析为属性值或 null

Parameters

scope

用于执行此操作的协程作用域。

xpath

目标元素的XPath。

attributeName

要获取的属性名称。