mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
go to pas hub with playwright
This commit is contained in:
parent
142024550e
commit
a146c7d82e
3 changed files with 14 additions and 3 deletions
|
|
@ -6,6 +6,7 @@ psycopg2-binary==2.9.10
|
|||
python-jose==3.3.0
|
||||
cryptography==43.0.3
|
||||
mangum==0.19.0
|
||||
playwright==1.58.0
|
||||
# AWS
|
||||
boto3==1.35.44
|
||||
# Data
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
FROM mcr.microsoft.com/playwright/python:v1.42.0
|
||||
FROM mcr.microsoft.com/playwright/python:v1.58.0-jammy
|
||||
|
||||
# Install AWS Lambda RIE
|
||||
ADD https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie /usr/local/bin/aws-lambda-rie
|
||||
RUN chmod +x /usr/local/bin/aws-lambda-rie
|
||||
|
||||
# Install Lambda runtime client
|
||||
RUN pip install awslambdaric
|
||||
RUN pip install awslambdaric playwright==1.58.0
|
||||
|
||||
# Set working directory (Lambda task root)
|
||||
WORKDIR /var/task
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
from typing import Any, Mapping
|
||||
|
||||
from playwright.sync_api import sync_playwright
|
||||
|
||||
from utils.logger import setup_logger
|
||||
|
||||
|
||||
|
|
@ -7,4 +9,12 @@ logger = setup_logger()
|
|||
|
||||
|
||||
def handler(event: Mapping[str, Any], context: Any) -> None:
|
||||
logger.info("Received message")
|
||||
logger.info("Starting Playwright flow")
|
||||
|
||||
with sync_playwright() as p:
|
||||
browser = p.chromium.launch(headless=True)
|
||||
page = browser.new_page()
|
||||
|
||||
page.goto("https://pashub.net/")
|
||||
|
||||
logger.info(f"Page title: {page.title()}")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue