ElementHandle.boxModel() 方法
🌐 ElementHandle.boxModel() method
此方法返回元素的框,或者如果元素不属于布局,则返回 null(示例:display: none)。
🌐 This method returns boxes of the element, or null if the element is not part of the layout (example: display: none).
语法
🌐 Signature
class ElementHandle {
boxModel(): Promise<BoxModel | null>;
}
返回:
Promise<BoxModel | null>
附注
🌐 Remarks
盒子表示为一个点数组;每个点是一个对象 {x, y}。盒子的点按顺时针排序。
🌐 Boxes are represented as an array of points; Each Point is an object {x, y}. Box points are sorted clock-wise.