@@ -458,15 +458,16 @@ def new_id(prefix: str) -> str:
458458 # Generic fallback
459459 return {"status" : "mock" , "url" : url , "method" : method , "kwargs" : kwargs }
460460
461- def markdownify (self , website_url : str , headers : Optional [dict [str , str ]] = None , mock : bool = False , render_heavy_js : bool = False , stealth : bool = False , return_toon : bool = False ):
461+ def markdownify (self , website_url : str , headers : Optional [dict [str , str ]] = None , mock : bool = False , render_heavy_js : bool = False , stealth : bool = False , wait_ms : Optional [ int ] = None , return_toon : bool = False ):
462462 """Send a markdownify request
463-
463+
464464 Args:
465465 website_url: The URL to convert to markdown
466466 headers: Optional HTTP headers
467467 mock: Enable mock mode for testing
468468 render_heavy_js: Enable heavy JavaScript rendering
469469 stealth: Enable stealth mode to avoid bot detection
470+ wait_ms: Number of milliseconds to wait before scraping the website
470471 return_toon: If True, return response in TOON format (reduces token usage by 30-60%)
471472 """
472473 logger .info (f"🔍 Starting markdownify request for { website_url } " )
@@ -479,7 +480,7 @@ def markdownify(self, website_url: str, headers: Optional[dict[str, str]] = None
479480 if return_toon :
480481 logger .debug ("🎨 TOON format output enabled" )
481482
482- request = MarkdownifyRequest (website_url = website_url , headers = headers , mock = mock , render_heavy_js = render_heavy_js , stealth = stealth )
483+ request = MarkdownifyRequest (website_url = website_url , headers = headers , mock = mock , render_heavy_js = render_heavy_js , stealth = stealth , wait_ms = wait_ms )
483484 logger .debug ("✅ Request validation passed" )
484485
485486 result = self ._make_request (
@@ -515,6 +516,7 @@ def scrape(
515516 headers : Optional [dict [str , str ]] = None ,
516517 mock :bool = False ,
517518 stealth :bool = False ,
519+ wait_ms : Optional [int ] = None ,
518520 return_toon : bool = False ,
519521 ):
520522 """Send a scrape request to get HTML content from a website
@@ -526,6 +528,7 @@ def scrape(
526528 headers: Optional headers to send with the request
527529 mock: Enable mock mode for testing
528530 stealth: Enable stealth mode to avoid bot detection
531+ wait_ms: Number of milliseconds to wait before scraping the website
529532 return_toon: If True, return response in TOON format (reduces token usage by 30-60%)
530533 """
531534 logger .info (f"🔍 Starting scrape request for { website_url } " )
@@ -544,7 +547,8 @@ def scrape(
544547 branding = branding ,
545548 headers = headers ,
546549 mock = mock ,
547- stealth = stealth
550+ stealth = stealth ,
551+ wait_ms = wait_ms ,
548552 )
549553 logger .debug ("✅ Request validation passed" )
550554
@@ -631,6 +635,7 @@ def smartscraper(
631635 plain_text : bool = False ,
632636 render_heavy_js : bool = False ,
633637 stealth : bool = False ,
638+ wait_ms : Optional [int ] = None ,
634639 return_toon : bool = False ,
635640 ):
636641 """
@@ -655,6 +660,7 @@ def smartscraper(
655660 plain_text: Return plain text instead of structured data
656661 render_heavy_js: Enable heavy JavaScript rendering
657662 stealth: Enable stealth mode to avoid bot detection
663+ wait_ms: Number of milliseconds to wait before scraping the website
658664 return_toon: If True, return response in TOON format (reduces token usage by 30-60%)
659665
660666 Returns:
@@ -701,6 +707,7 @@ def smartscraper(
701707 plain_text = plain_text ,
702708 render_heavy_js = render_heavy_js ,
703709 stealth = stealth ,
710+ wait_ms = wait_ms ,
704711 )
705712 logger .debug ("✅ Request validation passed" )
706713
0 commit comments