Skip to main content
Version: 24.38.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>;
}

返回:

Promise<BoundingBox | null>