Home > OS >  Scrape table with rvest by clicking on button
Scrape table with rvest by clicking on button

Time:05-02

I'm working with financial data and i want to scrape data from this site web. Inspection of the web

I change the date by the old date remain in the

but the source code show there function

CodePudding user response:

I see a POST API request called for historic data with the params as below:

'ticker'= 'BRVMAG', 'datedeb'= '2022-02-01', 'datefin'= '2022-03-29','xperiod'= '0'

I tested with removing headers and cookies and it seems they are not needed.


library(httr2)
library(magrittr)

r <- request("https://www.sikafinance.com/api/general/GetHistos") %>% 
  req_body_json(list('ticker'= 'BRVMAG', 'datedeb'= '2022-02-01', 'datefin'= '2022-03-29','xperiod'= '0')) %>% 
  req_perform() %>%
  resp_body_json(simplifyVector = T)
  • Related