Skip to main content
Version: 23.2.0

ElementHandle.boundingBox() 方法

¥ElementHandle.boundingBox() method

此方法返回元素的边界框(相对于主框架),如果元素是 不是布局的一部分,则返回 null(例如:display: none).

¥This method returns the bounding box of the element (relative to the main frame), or null if the element is not part of the layout (example: display: none).

签名

¥Signature

class ElementHandle {
boundingBox(): Promise<BoundingBox | null>;
}

Returns:

Promise<BoundingBox | null>