r - Get table from one frame HTML using Rcurl and XML -


how 1 table on search in http://portal.inep.gov.br/basica-censo-escolar-matricula

the table within th frame.

i have select state owns data: e.g acre , click in "consultar"

how can this?

you can selenium

require(rselenium) appurl <- "http://portal.inep.gov.br/basica-censo-escolar-matricula" rselenium::startserver() remdr <- remotedriver() remdr$open() remdr$navigate(appurl)  # find iframes iframes <- remdr$findelements("css selector", "iframe") iframes[[1]]$highlightelement() # visual check remdr$switchtoframe(iframes[[1]])  # estado selections webelems <- remdr$findelements("css selector", "#uf option") estadonames <- sapply(webelems, function(x){x$getelementtext()[[1]]}) webelem <- webelems[[which(estadonames == "acre")]] webelem$clickelement()  # click submit button webelem <- remdr$findelement("id", "btnsubmit") webelem$clickelement()  # find table webelem <- remdr$findelement("css selector",".resultado") webelem$highlightelement() # visual confirmation tablehtml <- webelem$getelementattribute("outerhtml")[[1]]  remdr$close() remdr$closeserver() 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -