Skip to content

Commit 3fe981f

Browse files
committed
Set scrape baseline to block images by default
1 parent eaec3cc commit 3fe981f

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Request body (full options):
105105
"max_retries": 2,
106106
"wait_for_selector": "h1",
107107
"wait_timeout_seconds": 15,
108-
"block_images": false,
108+
"block_images": true,
109109
"block_images_and_css": false,
110110
"wait_for_complete_page_load": true,
111111
"user_agent": "Mozilla/5.0 ...",
@@ -126,7 +126,7 @@ Request options (contract):
126126
- `max_retries`: `0..3`, default `2` (attempts = `1 + max_retries`, with `auto` capped by 3 strategy steps).
127127
- `wait_for_selector`: if set, response waits for selector before capture.
128128
- `wait_timeout_seconds`: selector wait timeout (capped by service timeout).
129-
- `block_images`: pass image blocking to driver.
129+
- `block_images`: pass image blocking to driver. Default `true`.
130130

131131
Currently accepted passthrough options (implemented, not part of stable request-options contract):
132132

app/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class ScrapeRequest(BaseModel):
6464
ge=1,
6565
le=DEFAULT_SCRAPE_TIMEOUT_SECONDS,
6666
)
67-
block_images: bool = False
67+
block_images: bool = True
6868
block_images_and_css: bool = False
6969
wait_for_complete_page_load: bool = True
7070
user_agent: Optional[str] = None

tests/test_api_contract.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def test_request_defaults(self):
5959
payload = main.ScrapeRequest(url="https://example.com")
6060
self.assertEqual(payload.navigation_mode, "auto")
6161
self.assertEqual(payload.max_retries, 2)
62-
self.assertFalse(payload.block_images)
62+
self.assertTrue(payload.block_images)
6363
self.assertFalse(payload.block_images_and_css)
6464
self.assertTrue(payload.wait_for_complete_page_load)
6565
self.assertIsNone(payload.user_agent)

0 commit comments

Comments
 (0)