From 8c7ccda049d9982de41a332633722535ef19d3a4 Mon Sep 17 00:00:00 2001 From: leen Date: Tue, 24 Mar 2026 13:59:54 +0200 Subject: [PATCH] remove set-viewport from python examples --- python-examples/e-commerce-nested/api/details.py | 1 - python-examples/e-commerce-nested/api/list.py | 1 - python-examples/hybrid-automation/api/scraper/details.py | 1 - python-examples/hybrid-automation/api/scraper/list.py | 1 - python-examples/rpa-auth-example/api/book-consultations.py | 6 +----- python-examples/rpa-example/api/book-consultations.py | 4 ---- .../rpa-forms-example/api/insurance-form-filler.py | 1 - python-examples/stagehand/api/get-books.py | 2 -- python-examples/starter-auth/api/sample.py | 2 -- 9 files changed, 1 insertion(+), 18 deletions(-) diff --git a/python-examples/e-commerce-nested/api/details.py b/python-examples/e-commerce-nested/api/details.py index 9205cf40..67cb40ac 100644 --- a/python-examples/e-commerce-nested/api/details.py +++ b/python-examples/e-commerce-nested/api/details.py @@ -133,7 +133,6 @@ async def automation( "details_url": "https://www.example.com/product/item-1" } """ - await page.set_viewport_size({"width": 1280, "height": 800}) params = EcommereceDetailsParams(**params) if not params.details_url: raise ValueError("Params with details_url are required for this automation") diff --git a/python-examples/e-commerce-nested/api/list.py b/python-examples/e-commerce-nested/api/list.py index f78cf064..64d47a39 100644 --- a/python-examples/e-commerce-nested/api/list.py +++ b/python-examples/e-commerce-nested/api/list.py @@ -103,7 +103,6 @@ async def automation( then extracts product metadata (name, price, details_url) and uses extend_payload to trigger individual scrapes for each product's details. """ - await page.set_viewport_size({"width": 1280, "height": 800}) params = EcommereceListParams(**params) if not params.category_url: raise ValueError("category_url is required in params") diff --git a/python-examples/hybrid-automation/api/scraper/details.py b/python-examples/hybrid-automation/api/scraper/details.py index 5cf44395..94869800 100644 --- a/python-examples/hybrid-automation/api/scraper/details.py +++ b/python-examples/hybrid-automation/api/scraper/details.py @@ -246,7 +246,6 @@ async def automation( "details_url": "https://www.example.com/product/item-1" } """ - await page.set_viewport_size({"width": 1280, "height": 800}) params = EcommereceDetailsParams(**params) if not params.details_url: raise ValueError("Params with details_url are required for this automation") diff --git a/python-examples/hybrid-automation/api/scraper/list.py b/python-examples/hybrid-automation/api/scraper/list.py index 3f0521f0..ea6f7d7d 100644 --- a/python-examples/hybrid-automation/api/scraper/list.py +++ b/python-examples/hybrid-automation/api/scraper/list.py @@ -114,7 +114,6 @@ async def automation( then extracts product metadata (name, price, details_url) and uses extend_payload to trigger individual scrapes for each product's details. """ - await page.set_viewport_size({"width": 1280, "height": 800}) params = EcommereceListParams(**params) if not params.category_url: raise ValueError("category_url is required in params") diff --git a/python-examples/rpa-auth-example/api/book-consultations.py b/python-examples/rpa-auth-example/api/book-consultations.py index 23109370..985d33fc 100644 --- a/python-examples/rpa-auth-example/api/book-consultations.py +++ b/python-examples/rpa-auth-example/api/book-consultations.py @@ -49,11 +49,7 @@ async def automation( context: BrowserContext | None = None, **_kwargs, ) -> dict: - # Set the browser viewport size to 1080x720 pixels - # This ensures consistent rendering across different devices and screen sizes - # Some websites may display different layouts or elements based on viewport size - await page.set_viewport_size({"width": 1080, "height": 720}) - + # Step 1: Validate input parameters using schema # This ensures all required fields are present and properly formatted if params is None: diff --git a/python-examples/rpa-example/api/book-consultations.py b/python-examples/rpa-example/api/book-consultations.py index b2ac13d9..57f4a014 100644 --- a/python-examples/rpa-example/api/book-consultations.py +++ b/python-examples/rpa-example/api/book-consultations.py @@ -49,10 +49,6 @@ async def automation( context: BrowserContext | None = None, **_kwargs, ) -> dict: - # Set the browser viewport size to 1080x720 pixels - # This ensures consistent rendering across different devices and screen sizes - # Some websites may display different layouts or elements based on viewport size - await page.set_viewport_size({"width": 1080, "height": 720}) # Step 1: Validate input parameters using schema # This ensures all required fields are present and properly formatted diff --git a/python-examples/rpa-forms-example/api/insurance-form-filler.py b/python-examples/rpa-forms-example/api/insurance-form-filler.py index 16838953..3a40016e 100644 --- a/python-examples/rpa-forms-example/api/insurance-form-filler.py +++ b/python-examples/rpa-forms-example/api/insurance-form-filler.py @@ -40,7 +40,6 @@ async def automation(page: Page, params: ListParameters, *args: ..., **kwargs: . session_id = session.data.session_id print(f"✅ Session started: {session_id}") print("\nInitialized 🤘 Stagehand") - await page.set_viewport_size({"width": 1280, "height": 800}) async def perform_action(page: Page, instruction: str) -> None: for _ in range(3): diff --git a/python-examples/stagehand/api/get-books.py b/python-examples/stagehand/api/get-books.py index d3c2cdd3..0773c7e4 100644 --- a/python-examples/stagehand/api/get-books.py +++ b/python-examples/stagehand/api/get-books.py @@ -57,8 +57,6 @@ async def automation(page: Page, params: Params, **_kwargs): print(f"✅ Session started: {session_id}") print("\nInitialized 🤘 Stagehand") - await page.set_viewport_size({"width": 1280, "height": 800}) - category = params.get("category") all_books: list[BookDetails] = [] diff --git a/python-examples/starter-auth/api/sample.py b/python-examples/starter-auth/api/sample.py index 6813b3c1..a74d6263 100644 --- a/python-examples/starter-auth/api/sample.py +++ b/python-examples/starter-auth/api/sample.py @@ -9,8 +9,6 @@ class Params(TypedDict): async def automation(page: Page, params: Params | None = None, **_kwargs): - await page.set_viewport_size({"width": 1080, "height": 720}) - sandboxed_url = "https://sandbox.intuned.dev/consultations-auth/book" await go_to_url(page=page, url=sandboxed_url)