Collecting Cookies
get_cookies Functions
Websites may set cookies for a variety of purposes, from identifying returning users to storing user preference information.
Capturing and saving the cookies a website sends is easily done with Page Interactions using the get_cookies function. get_cookies accepts a timeout parameter to set how long to listen for new cookies, as demonstrated below:
Parameter
Required
Description
timeout
Optional
Default = 1000
Integer | Controls how long to wait for new cookies before storing all collected cookie data in ms.
Example Request
curl -X POST 'https://api.webit.live/api/v1/realtime/web' \
--header 'Authorization: Basic <credential string>' \
--header 'Content-Type: application/json' \
--data-raw '{
"url": "https://www.example.com",
"render": true,
"render_flow": [{
"get_cookies": {
"timeout": 1000
}
}]
}'Like all Page Interactions, infinite scrolling is capped by the global 120-second session timeout, and will be terminated if this limit is reached.
Example Response
get_cookies returns an array of cookies with a variety of relevant metadata, as shown in the example below:
Last updated
