fixes allrecipes scroll
Browse files
src/proxy_lite/browser/browser.py
CHANGED
|
@@ -8,7 +8,7 @@ from typing import Literal, Optional, Self
|
|
| 8 |
import platform
|
| 9 |
from playwright.async_api import Browser, BrowserContext, Page, Playwright, async_playwright
|
| 10 |
from playwright.async_api import TimeoutError as PlaywrightTimeoutError
|
| 11 |
-
from playwright_stealth import stealth_async
|
| 12 |
from pydantic import Field
|
| 13 |
from tenacity import before_sleep_log, retry, stop_after_delay, wait_exponential
|
| 14 |
|
|
@@ -107,7 +107,7 @@ class BrowserSession:
|
|
| 107 |
await self.context.new_page()
|
| 108 |
self.context.set_default_timeout(60_000)
|
| 109 |
self.current_page.set_default_timeout(60_000)
|
| 110 |
-
await stealth_async(self.current_page)
|
| 111 |
await self.context.add_init_script(
|
| 112 |
path=Path(__file__).with_name("add_custom_select.js"),
|
| 113 |
)
|
|
|
|
| 8 |
import platform
|
| 9 |
from playwright.async_api import Browser, BrowserContext, Page, Playwright, async_playwright
|
| 10 |
from playwright.async_api import TimeoutError as PlaywrightTimeoutError
|
| 11 |
+
from playwright_stealth import stealth_async, StealthConfig
|
| 12 |
from pydantic import Field
|
| 13 |
from tenacity import before_sleep_log, retry, stop_after_delay, wait_exponential
|
| 14 |
|
|
|
|
| 107 |
await self.context.new_page()
|
| 108 |
self.context.set_default_timeout(60_000)
|
| 109 |
self.current_page.set_default_timeout(60_000)
|
| 110 |
+
await stealth_async(self.current_page, StealthConfig(navigator_user_agent=False))
|
| 111 |
await self.context.add_init_script(
|
| 112 |
path=Path(__file__).with_name("add_custom_select.js"),
|
| 113 |
)
|