mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Merge pull request #1024 from Hestia-Homes/feature/pashub-to-ara
PasHub to Ara: Try to fix erroring lambda
This commit is contained in:
commit
ba51662ea5
1 changed files with 14 additions and 2 deletions
|
|
@ -7,14 +7,25 @@ from utils.logger import setup_logger
|
|||
logger = setup_logger()
|
||||
|
||||
|
||||
def get_token_from_local_storage(email: str, password: str, record_video: bool = False) -> str:
|
||||
def get_token_from_local_storage(
|
||||
email: str, password: str, record_video: bool = False
|
||||
) -> str:
|
||||
logger.info("Starting Playwright flow")
|
||||
|
||||
with sync_playwright() as p:
|
||||
logger.info("Playwright server started")
|
||||
|
||||
browser = p.chromium.launch(
|
||||
headless=True,
|
||||
args=["--no-sandbox", "--disable-dev-shm-usage"],
|
||||
args=[
|
||||
"--no-sandbox",
|
||||
"--disable-dev-shm-usage",
|
||||
"--disable-gpu",
|
||||
"--single-process",
|
||||
"--no-zygote",
|
||||
],
|
||||
)
|
||||
logger.info("Chromium launched successfully")
|
||||
|
||||
video_dir = None
|
||||
if record_video:
|
||||
|
|
@ -29,6 +40,7 @@ def get_token_from_local_storage(email: str, password: str, record_video: bool =
|
|||
else:
|
||||
context = browser.new_context()
|
||||
page = context.new_page()
|
||||
logger.info("Page created")
|
||||
|
||||
try:
|
||||
logger.info("Navigating to site...")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue