Added premium proxy config to ZenRows

This commit is contained in:
2026-06-04 21:22:45 -07:00
parent 6f96d75f11
commit 93082f13b0

View File

@@ -22,6 +22,7 @@ class ZenRowsScraper:
js_render: bool = True, js_render: bool = True,
wait: Optional[int] = None, wait: Optional[int] = None,
wait_for: Optional[str] = None, wait_for: Optional[str] = None,
premium_proxy: bool = False,
): ):
"""Scrape a URL using ZenRows scraping SDK. """Scrape a URL using ZenRows scraping SDK.
@@ -30,11 +31,14 @@ class ZenRowsScraper:
js_render: whether to wait for JavaScript to execute js_render: whether to wait for JavaScript to execute
wait: milliseconds to wait after page load wait: milliseconds to wait after page load
wait_for: css selector to wait for wait_for: css selector to wait for
premium_proxy: use residential proxy (ZenRows premium_proxy=true)
""" """
self.logger.debug(f"ZenRows scraping url: {url}...") self.logger.debug(f"ZenRows scraping url: {url}...")
params: dict = {} params: dict = {}
if js_render: if js_render:
params["js_render"] = "true" params["js_render"] = "true"
if premium_proxy:
params["premium_proxy"] = "true"
if wait is not None: if wait is not None:
params["wait"] = str(wait) params["wait"] = str(wait)
if wait_for is not None: if wait_for is not None: