@@ -97,12 +97,11 @@ response = client.extract(
9797 prompt = " Extract the main heading and description" ,
9898 output_schema = MyPydanticModel,
9999 fetch_config = FetchConfig(
100+ mode = " js+stealth" ,
100101 headers = {" User-Agent" : " MyBot" },
101102 cookies = {" session" : " abc123" },
102103 scrolls = 3 ,
103- render_js = True ,
104- stealth = True ,
105- wait_ms = 2000 ,
104+ wait = 2000 ,
106105 ),
107106)
108107```
@@ -115,9 +114,9 @@ response = client.extract(
115114| ` headers ` | ` fetch_config=FetchConfig(headers=...) ` |
116115| ` cookies ` | ` fetch_config=FetchConfig(cookies=...) ` |
117116| ` number_of_scrolls ` | ` fetch_config=FetchConfig(scrolls=...) ` |
118- | ` render_heavy_js ` | ` fetch_config=FetchConfig(render_js=...) ` |
119- | ` stealth ` | ` fetch_config=FetchConfig(stealth=...) ` |
120- | ` wait_ms ` | ` fetch_config=FetchConfig(wait_ms =...) ` |
117+ | ` render_heavy_js ` | ` fetch_config=FetchConfig(mode="js") ` or ` mode="js+stealth" ` |
118+ | ` stealth ` | ` fetch_config=FetchConfig(mode="direct+stealth") ` or ` mode="js+stealth" ` |
119+ | ` wait_ms ` | ` fetch_config=FetchConfig(wait =...) ` |
121120| ` mock ` | Removed |
122121| ` plain_text ` | Removed |
123122| ` total_pages ` | Removed |
@@ -163,7 +162,7 @@ response = client.search(
163162| ` num_results ` | ` num_results ` (unchanged) |
164163| ` output_schema ` | ` output_schema ` (unchanged) |
165164| ` extraction_mode ` | Removed (always AI extraction) |
166- | ` stealth ` | Removed |
165+ | ` stealth ` | Removed (use ` fetch_config=FetchConfig(mode=...) ` on other endpoints) |
167166| ` location_geo_code ` | Removed |
168167| ` time_range ` | Removed |
169168| ` mock ` | Removed |
@@ -211,9 +210,8 @@ response = client.scrape(
211210 " https://example.com" ,
212211 format = " markdown" ,
213212 fetch_config = FetchConfig(
214- render_js = True ,
215- stealth = True ,
216- wait_ms = 2000 ,
213+ mode = " js+stealth" ,
214+ wait = 2000 ,
217215 headers = {" User-Agent" : " MyBot" },
218216 ),
219217)
@@ -222,11 +220,11 @@ response = client.scrape(
222220| v1 parameter | v2 equivalent |
223221| ---| ---|
224222| ` website_url ` | ` url ` (positional) |
225- | ` render_heavy_js ` | ` fetch_config=FetchConfig(render_js=...) ` |
223+ | ` render_heavy_js ` | ` fetch_config=FetchConfig(mode="js") ` or ` mode="js+stealth" ` |
226224| ` branding ` | ` format="branding" ` |
227225| ` headers ` | ` fetch_config=FetchConfig(headers=...) ` |
228- | ` stealth ` | ` fetch_config=FetchConfig(stealth=...) ` |
229- | ` wait_ms ` | ` fetch_config=FetchConfig(wait_ms =...) ` |
226+ | ` stealth ` | ` fetch_config=FetchConfig(mode="direct+stealth") ` or ` mode="js+stealth" ` |
227+ | ` wait_ms ` | ` fetch_config=FetchConfig(wait =...) ` |
230228| ` mock ` | Removed |
231229| ` return_toon ` | Removed |
232230
@@ -254,7 +252,7 @@ response = client.markdownify(
254252response = client.scrape(
255253 " https://example.com" ,
256254 format = " markdown" ,
257- fetch_config = FetchConfig(render_js = True , stealth = True ),
255+ fetch_config = FetchConfig(mode = " js+ stealth" ),
258256)
259257```
260258
@@ -305,9 +303,8 @@ response = client.crawl.start(
305303 include_patterns = [" /blog/*" ],
306304 exclude_patterns = [" /admin/*" ],
307305 fetch_config = FetchConfig(
308- render_js = True ,
309- stealth = True ,
310- wait_ms = 1000 ,
306+ mode = " js+stealth" ,
307+ wait = 1000 ,
311308 headers = {" User-Agent" : " MyBot" },
312309 ),
313310)
@@ -332,7 +329,7 @@ client.crawl.resume(crawl_id)
332329| ` max_pages ` | ` max_pages ` (unchanged) |
333330| ` include_paths ` | ` include_patterns ` |
334331| ` exclude_paths ` | ` exclude_patterns ` |
335- | ` headers ` , ` stealth ` , ` render_heavy_js ` , ` wait_ms ` | Moved to ` fetch_config=FetchConfig(...) ` |
332+ | ` headers ` , ` stealth ` , ` render_heavy_js ` , ` wait_ms ` | Moved to ` fetch_config=FetchConfig(mode=..., wait=..., headers= ...) ` |
336333| ` same_domain_only ` | Removed |
337334| ` batch_size ` | Removed |
338335| ` sitemap ` | Removed |
@@ -402,7 +399,7 @@ monitor = client.monitor.create(
402399 prompt = " Extract company info" ,
403400 cron = " 0 9 * * *" ,
404401 output_schema = {" type" : " object" , " properties" : {" name" : {" type" : " string" }}},
405- fetch_config = FetchConfig(stealth = True ),
402+ fetch_config = FetchConfig(mode = " direct+stealth " ),
406403 llm_config = LlmConfig(temperature = 0.1 ),
407404)
408405
@@ -530,17 +527,27 @@ Controls how pages are fetched. Used by `scrape()`, `extract()`, `crawl.start()`
530527from scrapegraph_py import FetchConfig
531528
532529config = FetchConfig(
533- mock = False , # Use mock mode for testing
534- stealth = True , # Avoid bot detection
535- scrolls = 3 , # Number of page scrolls (0-100)
536- country = " us" , # Geo-located requests
537- cookies = {" k" : " v" }, # Cookies to send
530+ mode = " js+stealth" , # Fetch mode: auto, fast, js, direct+stealth, js+stealth
531+ timeout = 30000 , # Request timeout in ms (1000-60000)
532+ wait = 2000 , # Wait after page load in ms (0-30000)
538533 headers = {" k" : " v" }, # Custom HTTP headers
539- wait_ms = 2000 , # Wait before scraping (ms)
540- render_js = True , # Render heavy JavaScript
534+ cookies = {" k" : " v" }, # Cookies to send
535+ country = " us" , # Two-letter country code for geo-located requests
536+ scrolls = 3 , # Number of page scrolls (0-100)
537+ mock = False , # Use mock mode for testing
541538)
542539```
543540
541+ ** Available fetch modes:**
542+
543+ | Mode | Description |
544+ | ---| ---|
545+ | ` auto ` | Automatically selects the best provider chain (default) |
546+ | ` fast ` | Direct HTTP fetch via impit — fastest, no JS rendering |
547+ | ` js ` | Headless browser rendering for JavaScript-heavy pages |
548+ | ` direct+stealth ` | Residential proxy with stealth headers, no JS |
549+ | ` js+stealth ` | JS rendering combined with stealth/residential proxy |
550+
544551### LlmConfig
545552
546553Controls the AI model used for extraction. Used by ` extract() ` , ` search() ` , and ` monitor.create() ` .
@@ -639,7 +646,7 @@ For a fast migration, search your codebase for these patterns:
639646| ` client.replace_scheduled_job( ` | Remove |
640647| ` client.get_job_executions( ` | Remove |
641648| ` return_toon=True ` | Remove |
642- | ` render_heavy_js= ` | ` fetch_config=FetchConfig(render_js=...) ` |
649+ | ` render_heavy_js= ` | ` fetch_config=FetchConfig(mode="js") ` or ` mode="js+stealth" ` |
643650| ` from scrapegraph_py.models.smartscraper import ` | Remove |
644651| ` from scrapegraph_py.models.searchscraper import ` | Remove |
645652| ` from scrapegraph_py.models.markdownify import ` | Remove |
0 commit comments