I’m trying to scrape this page with the rvest R package: https://www.bienici.com/recherche/achat/dessin-669cc780ec9a6600b7687ce8/2-pieces?prix-max=260000&surface-min=40&surface-max=55&neuf=non&mode=liste&tri=publication-desc
But I can’t retrieve the elements by id, class or Xpath, the results is always {xml_nodeset (0)}. I don’t know why habitually it works well.
library(dplyr)
library(rvest)
url <- 'https://www.bienici.com/recherche/achat/dessin-669cc780ec9a6600b7687ce8/2-pieces?prix-max=260000&surface-min=40&surface-max=55&neuf=non&mode=liste&tri=publication-desc'
# for example getting the h3 title of each result
url %>%
read_html %>%
html_nodes('h3')
# or by Xpath
url %>%
read_html %>%
html_nodes(xpath = '//*[@id="searchResults"]/div/div[1]/div[1]/div/article[1]/div/div/div/div[1]/div/div/div/a/div[2]/div[1]/h3/span[1]')
New contributor
fleborgne is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.