Skip to content

Commit a26c75e

Browse files
authored
Merge pull request #202 from Intuned/remove-set-viewport-size
remove set-viewport from python examples
2 parents a64b242 + 8c7ccda commit a26c75e

File tree

9 files changed

+1
-18
lines changed

9 files changed

+1
-18
lines changed

python-examples/e-commerce-nested/api/details.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ async def automation(
133133
"details_url": "https://www.example.com/product/item-1"
134134
}
135135
"""
136-
await page.set_viewport_size({"width": 1280, "height": 800})
137136
params = EcommereceDetailsParams(**params)
138137
if not params.details_url:
139138
raise ValueError("Params with details_url are required for this automation")

python-examples/e-commerce-nested/api/list.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ async def automation(
103103
then extracts product metadata (name, price, details_url) and uses
104104
extend_payload to trigger individual scrapes for each product's details.
105105
"""
106-
await page.set_viewport_size({"width": 1280, "height": 800})
107106
params = EcommereceListParams(**params)
108107
if not params.category_url:
109108
raise ValueError("category_url is required in params")

python-examples/hybrid-automation/api/scraper/details.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ async def automation(
246246
"details_url": "https://www.example.com/product/item-1"
247247
}
248248
"""
249-
await page.set_viewport_size({"width": 1280, "height": 800})
250249
params = EcommereceDetailsParams(**params)
251250
if not params.details_url:
252251
raise ValueError("Params with details_url are required for this automation")

python-examples/hybrid-automation/api/scraper/list.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ async def automation(
114114
then extracts product metadata (name, price, details_url) and uses
115115
extend_payload to trigger individual scrapes for each product's details.
116116
"""
117-
await page.set_viewport_size({"width": 1280, "height": 800})
118117
params = EcommereceListParams(**params)
119118
if not params.category_url:
120119
raise ValueError("category_url is required in params")

python-examples/rpa-auth-example/api/book-consultations.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,7 @@ async def automation(
4949
context: BrowserContext | None = None,
5050
**_kwargs,
5151
) -> dict:
52-
# Set the browser viewport size to 1080x720 pixels
53-
# This ensures consistent rendering across different devices and screen sizes
54-
# Some websites may display different layouts or elements based on viewport size
55-
await page.set_viewport_size({"width": 1080, "height": 720})
56-
52+
5753
# Step 1: Validate input parameters using schema
5854
# This ensures all required fields are present and properly formatted
5955
if params is None:

python-examples/rpa-example/api/book-consultations.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ async def automation(
4949
context: BrowserContext | None = None,
5050
**_kwargs,
5151
) -> dict:
52-
# Set the browser viewport size to 1080x720 pixels
53-
# This ensures consistent rendering across different devices and screen sizes
54-
# Some websites may display different layouts or elements based on viewport size
55-
await page.set_viewport_size({"width": 1080, "height": 720})
5652

5753
# Step 1: Validate input parameters using schema
5854
# This ensures all required fields are present and properly formatted

python-examples/rpa-forms-example/api/insurance-form-filler.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ async def automation(page: Page, params: ListParameters, *args: ..., **kwargs: .
4040
session_id = session.data.session_id
4141
print(f"✅ Session started: {session_id}")
4242
print("\nInitialized 🤘 Stagehand")
43-
await page.set_viewport_size({"width": 1280, "height": 800})
4443

4544
async def perform_action(page: Page, instruction: str) -> None:
4645
for _ in range(3):

python-examples/stagehand/api/get-books.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ async def automation(page: Page, params: Params, **_kwargs):
5757
print(f"✅ Session started: {session_id}")
5858
print("\nInitialized 🤘 Stagehand")
5959

60-
await page.set_viewport_size({"width": 1280, "height": 800})
61-
6260
category = params.get("category")
6361
all_books: list[BookDetails] = []
6462

python-examples/starter-auth/api/sample.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ class Params(TypedDict):
99

1010

1111
async def automation(page: Page, params: Params | None = None, **_kwargs):
12-
await page.set_viewport_size({"width": 1080, "height": 720})
13-
1412
sandboxed_url = "https://sandbox.intuned.dev/consultations-auth/book"
1513

1614
await go_to_url(page=page, url=sandboxed_url)

0 commit comments

Comments
 (0)