diff --git a/python-examples/e-commerce-nested/api/category.py b/python-examples/e-commerce-nested/api/category.py index 0d915765..16e0b797 100644 --- a/python-examples/e-commerce-nested/api/category.py +++ b/python-examples/e-commerce-nested/api/category.py @@ -69,7 +69,6 @@ async def automation( This function collects category metadata (name, url) from the main menu and then uses extend_payload to trigger individual scrapes for each category's products. """ - await page.set_viewport_size({"width": 1280, "height": 800}) params = EcommereceCategoryParams(**params) if not params.store_url: raise ValueError("store_url is required in params") diff --git a/typescript-examples/e-commerce-nested/api/category.ts b/typescript-examples/e-commerce-nested/api/category.ts index 83da55f8..0367ab01 100644 --- a/typescript-examples/e-commerce-nested/api/category.ts +++ b/typescript-examples/e-commerce-nested/api/category.ts @@ -74,7 +74,6 @@ async function handler( page: Page, context: BrowserContext ): Promise<{ categories: Category[] }> { - await page.setViewportSize({ width: 1280, height: 800 }); if (!params || !params.store_url) { throw new Error("store_url is required in params"); diff --git a/typescript-examples/e-commerce-nested/api/details.ts b/typescript-examples/e-commerce-nested/api/details.ts index 2105a6f8..7459b278 100644 --- a/typescript-examples/e-commerce-nested/api/details.ts +++ b/typescript-examples/e-commerce-nested/api/details.ts @@ -162,7 +162,7 @@ async function handler( page: Page, context: BrowserContext ): Promise { - await page.setViewportSize({ width: 1280, height: 800 }); + if (!params || !params.details_url) { throw new Error("Params with details_url are required for this automation"); diff --git a/typescript-examples/e-commerce-nested/api/list.ts b/typescript-examples/e-commerce-nested/api/list.ts index eb41c396..8c249241 100644 --- a/typescript-examples/e-commerce-nested/api/list.ts +++ b/typescript-examples/e-commerce-nested/api/list.ts @@ -115,8 +115,6 @@ async function handler( page: Page, context: BrowserContext ): Promise<{ category: string; products: Product[] }> { - await page.setViewportSize({ width: 1280, height: 800 }); - if (!params || !params.category_url) { throw new Error("category_url is required in params"); } diff --git a/typescript-examples/hybrid-automation/api/scraper/details.ts b/typescript-examples/hybrid-automation/api/scraper/details.ts index 114a9887..703e5a00 100644 --- a/typescript-examples/hybrid-automation/api/scraper/details.ts +++ b/typescript-examples/hybrid-automation/api/scraper/details.ts @@ -196,7 +196,6 @@ export default async function handler( page: Page, context: BrowserContext ): Promise { - await page.setViewportSize({ width: 1280, height: 800 }); const { name: paramName, details_url } = detailsParamsSchema.parse(params); diff --git a/typescript-examples/hybrid-automation/api/scraper/list.ts b/typescript-examples/hybrid-automation/api/scraper/list.ts index 26e868d0..31d9122d 100644 --- a/typescript-examples/hybrid-automation/api/scraper/list.ts +++ b/typescript-examples/hybrid-automation/api/scraper/list.ts @@ -90,7 +90,6 @@ export default async function handler( page: Page, context: BrowserContext ) { - await page.setViewportSize({ width: 1280, height: 800 }); const { category_name, category_url } = listParamsSchema.parse(params); diff --git a/typescript-examples/rpa-auth-example/api/book-consultations.ts b/typescript-examples/rpa-auth-example/api/book-consultations.ts index 5ad1dd90..af7fbcac 100644 --- a/typescript-examples/rpa-auth-example/api/book-consultations.ts +++ b/typescript-examples/rpa-auth-example/api/book-consultations.ts @@ -60,14 +60,7 @@ export default async function handler( page: Page, context: BrowserContext ) { - // 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.setViewportSize({ - width: 1080, - height: 720, - }); - + // Step 1: Validate input parameters using schema // This ensures all required fields are present and properly formatted const validatedParams = bookConsultationSchema.parse(params); diff --git a/typescript-examples/rpa-example/api/book-consultations.ts b/typescript-examples/rpa-example/api/book-consultations.ts index 38f1971c..ce661a46 100644 --- a/typescript-examples/rpa-example/api/book-consultations.ts +++ b/typescript-examples/rpa-example/api/book-consultations.ts @@ -66,13 +66,6 @@ export default async function handler( page: Page, context: BrowserContext ): Promise { - // 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.setViewportSize({ - width: 1080, - height: 720, - }); // Step 1: Validate input parameters using schema // This ensures all required fields are present and properly formatted diff --git a/typescript-examples/rpa-forms-example/api/insurance-form-filler.ts b/typescript-examples/rpa-forms-example/api/insurance-form-filler.ts index edd36c7b..c82e61d0 100644 --- a/typescript-examples/rpa-forms-example/api/insurance-form-filler.ts +++ b/typescript-examples/rpa-forms-example/api/insurance-form-filler.ts @@ -71,7 +71,6 @@ export default async function handler( await stagehand.init(); console.log("\nInitialized 🤘 Stagehand"); // Validate parameters - await page.setViewportSize({ width: 1280, height: 800 }); const validatedParams = listParametersSchema.parse(params); const { metadata, applicant, address, vehicle } = validatedParams; diff --git a/typescript-examples/starter-auth/api/sample.ts b/typescript-examples/starter-auth/api/sample.ts index bb4c55a9..07dd457c 100644 --- a/typescript-examples/starter-auth/api/sample.ts +++ b/typescript-examples/starter-auth/api/sample.ts @@ -12,11 +12,6 @@ export default async function handler( page: Page, context: BrowserContext ) { - await page.setViewportSize({ - width: 1080, - height: 720, - }); - const sandboxedUrl = "https://sandbox.intuned.dev/consultations-auth/book"; await goToUrl({