Hey, I am working on a project where I have to do sentiment analysis on the reviews of particular movies. I have managed to get the scraping done on the first page but how could I get all the reviews distributed in more than 20 pages at once. I want to automate this process by using a loop or any other method. Thanks in advance.
Here is my code:
library(rvest)
read_html("https://www.rottentomatoes.com/m/dune_2021/reviews") %>%
html_elements(xpath = "//div[@class='the_review']") %>%
html_text2()
This code will get the reviews from the first page, but I want all the reviews. Please help!