Spaces:
Sleeping
Sleeping
Commit
·
5b51e03
1
Parent(s):
de68d43
version 1.0 fix
Browse files
app/core/service/playwright/playwright_context.py
CHANGED
@@ -10,7 +10,7 @@ from playwright.async_api import ( # noqa: F401
|
|
10 |
async_playwright,
|
11 |
)
|
12 |
|
13 |
-
from .models import
|
14 |
|
15 |
if TYPE_CHECKING:
|
16 |
from types import TracebackType
|
@@ -69,13 +69,9 @@ class AsyncPlaywrightContext:
|
|
69 |
async def get_content(
|
70 |
self,
|
71 |
get_content_model: GetContentModel,
|
72 |
-
browser_model: BrowserModel,
|
73 |
) -> str:
|
74 |
-
|
75 |
-
|
76 |
-
browser_model=browser_model,
|
77 |
-
)
|
78 |
-
page = browser_context.new_page()
|
79 |
await page.goto(str(get_content_model.url))
|
80 |
await page.wait_for_timeout(get_content_model.ms_delay)
|
81 |
|
|
|
10 |
async_playwright,
|
11 |
)
|
12 |
|
13 |
+
from .models import GetContentModel, PageModel, ScreenshotModel # noqa: TCH001
|
14 |
|
15 |
if TYPE_CHECKING:
|
16 |
from types import TracebackType
|
|
|
69 |
async def get_content(
|
70 |
self,
|
71 |
get_content_model: GetContentModel,
|
|
|
72 |
) -> str:
|
73 |
+
page = await self.new_browser_page(browser=self.browser, page_model=page_model)
|
74 |
+
|
|
|
|
|
|
|
75 |
await page.goto(str(get_content_model.url))
|
76 |
await page.wait_for_timeout(get_content_model.ms_delay)
|
77 |
|