From d4601f21c424ef63d8921c78f8d8783918168f90 Mon Sep 17 00:00:00 2001 From: kwkw Date: Thu, 5 Dec 2024 10:24:32 +0800 Subject: [PATCH] fix: object Locator can't be used in 'await' expression (#122) --- dataframe_image/converter/browser/playwright_converter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dataframe_image/converter/browser/playwright_converter.py b/dataframe_image/converter/browser/playwright_converter.py index da95a7d..a95ed41 100644 --- a/dataframe_image/converter/browser/playwright_converter.py +++ b/dataframe_image/converter/browser/playwright_converter.py @@ -98,8 +98,8 @@ async def screenshot(self, html): ) page = await context.new_page() await page.set_content(self.build_valid_html(html)) - locator = await page.locator("#dfi_table table") - bbox = locator.bounding_box() + locator = page.locator("#dfi_table table") + bbox = await locator.bounding_box() width = bbox["width"] height = bbox["height"] await page.set_viewport_size(