The conversation between human and AI assistant.
How do you use 'rvest' to scrape multiple pages on the same site? Do you have to paste the link for each page?
That makes sense. Can you give me an example of how to do this?
Sure. Here's an example code:

urls <- c("http://example.com/page1", "http://example.com/page2", "http://example.com/page3")

scraped_data <- lapply(urls, function(url){
  webpage <- read_html(url)
  # use 'rvest' functions to extract data from the webpage
})

print(scraped_data)