I’ve managed to get RSelenium to work and so far I’ve been successful in extracting some data from the following website: https://www.immobiliare.it/vendita-case/belluno-provincia/?criterio=rilevanza
However, my problem is that I can’t seem to make Selenium to move to the next pages.
library(RSelenium)
library(netstat)
rs_driver_obj <- rsDriver(browser = "chrome", chromever = "126.0.6478.126", verbose = FALSE, port = free_port())
remDr <- rs_driver_obj$client remDr$open() remDr$navigate("https://www.immobiliare.it/vendita-case/belluno-provincia/?criterio=rilevanza")
remDr$executeScript("window.scrollTo(0,document.body.scrollHeight);") next_button <- remDr$findElement(using = "xpath", "//a[starts-with(@class,'in-pagination__item nd-button nd-button--ghost')]") next_button$clickElement()
I get a weird error saying that it’s a StaleElementReference.
How would I go about looping over all the pages in the URL provided above?
crossgamma is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.