I'm trying to scrape several webpages using the following code
library(rvest)
library(dplyr)
glasgow <- 'https://glasgow.gov.uk/article/24653/European-Settlement-Service'
rsg <- 'https://www.romasupportgroup.org.uk/roma-and-brexit.html'
urls<-c(rsg, glasgow)
urls_rh<-map(urls, read_html)
text <- map(urls_rh, html_node('.div'))
But I get the following error message
Error in UseMethod("xml_find_first"): no method for 'xml_find_first' applicable for an object of class "character" Traceback:
- map(urls_rh, html_node(".div"))
- as_mapper(.f, ...)
- html_node(".div")
- html_node.default(".div")
- xml2::xml_find_first(x, make_selector(css, xpath))
I also tried using a for loop, with the same result
for (i in urls_rh){
text <- html_node("div")
}
Any advice?