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