How to use html_nodes in a dynamic webpage

xml2
rvest
magrittr

#1

I would like to get all the news title and short description of this webpage but it returns "character (0)".

Here is what I did:

# News of WB
link_wb <- "http://www.worldbank.org/en/news/all?displayconttype_exact=Speeches+and+Transcripts&lang_exact=English&qterm="
wb_speechs <- read_html(link_wb)

# get the news title
wb_title <- wb_speechs %>%
  html_nodes(xpath = "/html/body/div[4]/div/div/customsearch/main/div/div/div/div[2]/news/div/div/div/div[2]/div/div[1]/ul/li/div/h4") %>%
  html_text()
wb_title

I've tried with some class, xpath and so on, but get no results. Please advice! Thank you a lot!


#2

Check out this recent thread regarding scraping dynamic webpages: