Extract the text of all list elements in r from html

# Load necessary libraries
library(rvest)

# Specify the URL of the HTML page
url <- "your_html_page_url_here"

# Read the HTML content from the specified URL
html_content <- read_html(url)

# Extract all list elements using CSS selectors
list_elements <- html_content %>% html_nodes("li")

# Extract text from each list element
list_text <- sapply(list_elements, function(x) {
  x %>% html_text()
})

# Print the extracted text
print(list_text)