If we visit this url in chrome, with devtools open, we can clearly see a cookie appear (in chrome developer tools -> 'application' -> 'cookies').
If we attempt the same thing using httr::GET()
, we expect to see the cookie, but we do not:
library(httr)
r <- GET("https://aps.dac.gov.in/LUS/Public/Reports.aspx")
r$cookies
# [1] domain flag path secure expiration name value
# <0 rows> (or 0-length row.names)
Why is this, and how can we retrieve the cookie (along with the page html) preferably using either httr
and/or rvest
(plus other suggestions but without using an actual browser, headless or otherwise, including selenium)