mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
修复元素截图时窗口外部分空白问题
This commit is contained in:
parent
0b96412146
commit
f7368c64e5
@ -904,7 +904,7 @@ class ChromiumBase(BasePage):
|
||||
h = right_bottom[1] - y
|
||||
vp = {'x': x, 'y': y, 'width': w, 'height': h, 'scale': 1}
|
||||
png = self.run_cdp_loaded('Page.captureScreenshot', format=pic_type,
|
||||
captureBeyondViewport=False, clip=vp)['data']
|
||||
captureBeyondViewport=True, clip=vp)['data']
|
||||
else:
|
||||
png = self.run_cdp_loaded('Page.captureScreenshot', format=pic_type)['data']
|
||||
|
||||
|
@ -518,8 +518,8 @@ class ChromiumElement(DrissionElement):
|
||||
while not self.run_js(js) and perf_counter() < end_time:
|
||||
sleep(.1)
|
||||
|
||||
self.scroll.to_see(center=True)
|
||||
sleep(1)
|
||||
# self.scroll.to_see(center=True)
|
||||
# sleep(1)
|
||||
left, top = self.location
|
||||
width, height = self.size
|
||||
left_top = (left, top)
|
||||
|
Loading…
x
Reference in New Issue
Block a user