1

I need to extract all the links from the menu of a page.

I've tried different css combinations but I cannot figure it out.

1° Approache:

library(rvest)     


linio_paths <- read_html("https://www.linio.com.pe") %>%
               html_nodes("#main-menu .subcategory-link") %>% 
               html_attr("href")

linio_paths #return character(0)

2° Approache:

library(rvest)     


linio_paths <- read_html("https://www.linio.com.pe") %>%
               html_nodes(".subcategory-link") %>% html_attr("href")

linio_paths #character(0)

I've visited this thread: Using 'rvest' to extract links

It did help me with another site, but not with this one. Thank you.

Omar Gonzales
  • 2,878
  • 7
  • 38
  • 83
  • Since they're loaded only when rolled over, it's easier to just scrape the site map (https://www.linio.com.pe/directorio), though check it's permitted by the Terms of Service. – alistaire Sep 04 '17 at 00:46
  • This is the way I ended up doing things. Thank you! – Omar Gonzales Sep 04 '17 at 04:06

0 Answers0