getCssValue

abstract fun getCssValue(xpath: String, propertyName: String): String?

获取由XPath指定的元素的计算后CSS样式属性值。

Return

计算后的CSS属性值字符串。如果元素不存在,返回null

Parameters

xpath

目标元素的XPath。

propertyName

CSS属性名,通常使用kebab-case (例如 "color", "font-size", "background-color")。