I’m trying to download some contents/data from a webpage with javascript rendered contents in R, After some searches I found a different solution but can’t get the exact required output,
here is one of the way so far I have tried
library(httr)
library(rjson)
link <- "https://rod.pulse.gop.pk/details_page.html?I=740287512"
response <- httr::POST(
url = "https://rodb.pulse.gop.pk/registry_index_2/_search",
httr::add_headers(
.headers = c(
"Authorization" = "'Basic ' + btoa('elastic:qZM2ov-qIa=UXr6+Gx8b')",
"Content-Type" = "application/json"
)
),
body = link
)
data <- fromJSON(content(response, as="text"))
required data at a glance
data <-
structure(list(Id = 740287512L, UserId = 13887L, VendorId = 1L,
UserWorkQueMasterId = 740237089L, RegisteredNumber = "310",
JildNumber = "1489", PropertyNumber = "واقع رقبہ موضع سوہان دیہاتی اندر حدود میونسپل کارپوریشن راولپنڈی تحصیل و ضلع راولپنڈی ",
IsApproved = TRUE, IsJildCompleted = FALSE, BahiNumber = NA,
RegistryDate = "1993-01-25", IsActive = TRUE, CreatedDate = "2023-10-23T20:09:19.310000",
ModifiedDate = NA, CreatedBy = 13887L, ModifiedBy = NA, TehsilId = 112L,
MauzaId = 0L, Address = "N/A", IsExported = NA, Area = "0-8-0-0",
RegistryValue = 128000, RegistryExportImg = "cfe958064b6c79b71e03350b5394f32a",
NonNullFCount = NA, NullFCount = NA, RegistryTypeId = 5L,
MauzaName = NA, RegistryParties = list(structure(list(Id = 18595212:18595213,
Name = c("محمد یسین ", "چوہدری رحمت "
), SpouseName = c("شمس الدین ", "چوہدری الله دین "
), CNIC = c("21134087515", "0"), RegistryPartiesTypeId = 1:2,
CraetedDate = c("2023-10-23T20:09:19.310000", "2023-10-23T20:09:19.310000"
), ModifiedDate = c(NA, NA), CreatedBy = c(13887L, 13887L
), ModifiedBy = c(NA, NA), VendorId = c(1L, 1L), SequenceNumber = 1:2,
RegistryExportImg = c("b17f19516a4fc8742aa21ce8bf0340b4",
"89c79a6b93dde25904088ce129b1a22a")), class = "data.frame", row.names = 1:2)),
RegistryType = "بیع", Tehsil = "راولپنڈی"), row.names = 1L, class = "data.frame")
all the data is publicly available and any efficient solution would be acceptable