mercredi 29 janvier 2020

Using rvest, xml2 and selector gadget for webscrapping results in xml_missing

I'm trying to scrap information from the following URL:

https://www.google.com/search?q=812-800%20H%20St%20NW

I want to retrieve the highlighted "812 H St NW": target

The selector gadget (chrome extension) suggests to use the following node ".desktop-title-content"

However, I get an NA as a result and I don't get how to fix this problem.

Here is my code:

link <- "https://www.google.com/search?q=812-800%20H%20St%20NW"
xml2::read_html(link) %>% 
  rvest::html_node(".desktop-title-content") %>%  rvest::html_text()

[1] NA

Thank you




Aucun commentaire:

Enregistrer un commentaire