library(rvest)
url <- "https://www.immobilienscout24.de/expose/120960754"
url %>%
read_html() %>%
html_nodes(xpath='//*[@id="is24-content"]/div[2]/div[1]/div[4]/div[4]/div[2]/div/div/div/div[1]/div[3]/div/div[5]/div/div/span')%>%
html_text()
完整的Xpath
/html/body/div[2]/div[4]/div[1]/div/div[3]/div[2]/div[1]/div[4]/div[4]/div[2]/div/div/div/div[1]/div[3]/div/div[5]/div/div/span
我需要取消的价值在这里:
<span class="additional-costs-value font-ms font-semibold">13.810 €</span>