View Source ZenRows.Config (zenrows v0.2.1)
Represents the configuration options for a ZenRows API request.
The ZenRows.Config
struct defines the available parameters that can be passed to the ZenRows API.
These parameters allow customization of the scraping behavior and enable additional features.
Refer to the ZenRows API Documentation for more details on each parameter.
Parameters
js_render
(optional): Render the JavaScript on the page with a headless browser. Default isfalse
. Enabling this option consumes 5 credits per request.premium_proxy
(optional): Use premium proxies to make the request harder to detect. Default isfalse
. Enabling this option consumes 10-25 credits per request.proxy_country
(optional): Geolocation of the IP used to make the request. Only applicable when using premium proxies. Example: "us".session_id
(optional): Send a session ID number to use the same IP for each API request for up to 10 minutes.device
(optional): Use either desktop or mobile user agents in the headers. Default is"desktop"
.original_status
(optional): Returns the status code provided by the website. Default isfalse
.wait_for
(optional): Wait for a given CSS selector to load in the DOM before returning the content.wait
(optional): Wait a fixed amount of time (in milliseconds) before returning the content. Default is0
.block_resources
(optional): Block specific resources from loading using this parameter.json_response
(optional): Get content in JSON format, including XHR or Fetch requests. Default isfalse
.window_width
(optional): Set the browser's window width. Default is1920
.window_height
(optional): Set the browser's window height. Default is1080
.css_extractor
(optional): Define CSS selectors to extract data from the HTML. Expects a JSON string.autoparse
(optional): Use the auto-parser algorithm to automatically extract data. Default isfalse
.return_screenshot
(optional): Return a full-page screenshot of the target page. Default isfalse
.resolve_captcha
(optional): Use a CAPTCHA solver integration to automatically solve interactive CAPTCHAs in the page. Default isfalse
.
Proxy countries
List of some available countries and their code, you can check out the whole list on the builder.
- United States: us
- Canada: ca
- United Kingdom: gb
- Germany: de
- France: fr
- Spain: es
- Brazil: br
- Mexico: mx
- India: in
- Japan: jp
- China: cn
Summary
Types
@type t() :: %ZenRows.Config{ autoparse: boolean() | nil, block_resources: binary() | nil, css_extractor: map() | nil, device: :desktop | :mobile | nil, js_render: boolean() | nil, json_response: boolean() | nil, original_status: boolean() | nil, premium_proxy: boolean() | nil, proxy_country: binary() | nil, resolve_captcha: boolean() | nil, return_screenshot: boolean() | nil, session_id: integer() | nil, wait: pos_integer() | nil, wait_for: binary() | nil, window_height: integer() | nil, window_width: integer() | nil }