I want to web scrape one table from following website: https://www.katastar.hr
To follow what I want, please open inspect, than click network. Now, when you open site you can see there is a URL: https://oss.uredjenazemlja.hr/rest/katHr/lrInstitutions/position?id=2432593&status=1332094865186&x=undefined&y=undefined
The problem is that id and status are different every time you open the site. How can I scrape output of the above request (which is a json, that is a table), when there is different GET queries every time?
I would give reproducible example, but there is nothing special I can try. I should start from home page, but I don't know how to proceed:
headers <- c(
"Accept" = 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
'Accept-Encoding' = "gzip, deflate, br",
'Accept-Language' = 'hr-HR,hr;q=0.9,en-US;q=0.8,en;q=0.7',
"Cache-Control" = "max-age=0",
"Connection" = "keep-alive",
"DNT" = "1",
"Host" = "www.katastar.hr",
"If-Modified-Since" = "Mon, 22 Mar 2021 13:39:38 GMT",
"Referer" = "https://www.google.com/",
"sec-ch-ua" = '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"',
"sec-ch-ua-mobile" = "?0",
"Sec-Fetch-Dest" = "document",
"Sec-Fetch-Mode" = "navigate",
"Sec-Fetch-Site" = "same-origin",
"Sec-Fetch-User" = "?1",
"Upgrade-Insecure-Requests" = "1",
"User-Agent" = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36"
)
p <- httr::GET(
"https://www.katastar.hr/",
add_headers(headers))
httr::cookies(p)
The code can be in both R and python.