Skip to content

Commit 2a02cb9

Browse files
committed
feat: update render_heavy_js
1 parent e07f5cd commit 2a02cb9

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

β€Žscrapegraph-py/scrapegraph_py/async_client.pyβ€Ž

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,9 @@ async def smartscraper(
573573
output_schema: Optional[BaseModel] = None,
574574
number_of_scrolls: Optional[int] = None,
575575
total_pages: Optional[int] = None,
576+
mock: bool = False,
577+
plain_text: bool = False,
578+
render_heavy_js: bool = False,
576579
stealth: bool = False,
577580
):
578581
"""Send a smartscraper request with optional pagination support and cookies"""
@@ -591,6 +594,8 @@ async def smartscraper(
591594
logger.debug(f"πŸ“„ Total pages to scrape: {total_pages}")
592595
if stealth:
593596
logger.debug("πŸ₯· Stealth mode enabled")
597+
if render_heavy_js:
598+
logger.debug("⚑ Heavy JavaScript rendering enabled")
594599
logger.debug(f"πŸ“ Prompt: {user_prompt}")
595600

596601
request = SmartScraperRequest(
@@ -602,6 +607,9 @@ async def smartscraper(
602607
output_schema=output_schema,
603608
number_of_scrolls=number_of_scrolls,
604609
total_pages=total_pages,
610+
mock=mock,
611+
plain_text=plain_text,
612+
render_heavy_js=render_heavy_js,
605613
stealth=stealth,
606614
)
607615

β€Žscrapegraph-py/scrapegraph_py/client.pyβ€Ž

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,9 +584,10 @@ def smartscraper(
584584
output_schema: Optional[BaseModel] = None,
585585
number_of_scrolls: Optional[int] = None,
586586
total_pages: Optional[int] = None,
587-
mock:bool=False,
588-
plain_text:bool=False,
589-
stealth:bool=False
587+
mock: bool = False,
588+
plain_text: bool = False,
589+
render_heavy_js: bool = False,
590+
stealth: bool = False
590591
):
591592
"""Send a smartscraper request with optional pagination support and cookies"""
592593
logger.info("πŸ” Starting smartscraper request")
@@ -604,6 +605,8 @@ def smartscraper(
604605
logger.debug(f"πŸ“„ Total pages to scrape: {total_pages}")
605606
if stealth:
606607
logger.debug("πŸ₯· Stealth mode enabled")
608+
if render_heavy_js:
609+
logger.debug("⚑ Heavy JavaScript rendering enabled")
607610
logger.debug(f"πŸ“ Prompt: {user_prompt}")
608611

609612
request = SmartScraperRequest(
@@ -617,6 +620,7 @@ def smartscraper(
617620
total_pages=total_pages,
618621
mock=mock,
619622
plain_text=plain_text,
623+
render_heavy_js=render_heavy_js,
620624
stealth=stealth,
621625
)
622626
logger.debug("βœ… Request validation passed")

0 commit comments

Comments
Β (0)