I am trying to webscrape Amazon's books names:
rm(list = ls())
library(rvest)
library(XML)
library(xml2)
url_amazon <- 'https://www.amazon.com/s/browse?_encoding=UTF8&node=283155&ref_=nav_shopall-export_nav_mw_sbd_intl_books'
web_page<-read_html(url_amazon)
By CSS SELECTOR:
rank_titles<-html_text(html_nodes(web_page,".a-link-normal .a-size-base"))
BY XPATH SELECTOR:
rank_titles<-html_text(html_nodes(web_page,xpath='//span[@class="a-size-base"]'))
But the names of the books are not in order. Why? What am I doing wrong?
Any help?