'Extract links from specific div - Rvest
I am trying to extract the links from a specific class from a website. However, there is a empty dataset when I do that.
library(rvest)
library(purrr)
library(dplyr)
links_avai <- paste0("https://avai.com.br/page", seq(from = 1, to = 2)) %>%
map(. %>%
read_html() %>%
html_nodes(xpath = '//*[@class="gdlr-blog-title"]') %>%
html_attr("href"))
Solution 1:[1]
links_avai <- paste0("https://avai.com.br/page", seq(from = 1, to = 2)) %>%
map(. %>%
read_html() %>%
html_nodes(xpath = '//*[@class="gdlr-blog-title"]') %>%
html_nodes("a") %>%
html_attr("href"))
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | fabiominatto |
