Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library("tidyr")
- library("dplyr")
- library("rvest")
- library("curl")
- ps4_score <- vector("list", 894)
- ps4_title <- vector("list", 894)
- index <- seq(0, 8, by=1)
- for(i in index) {
- ps4<-read_html(curl(paste0("http://www.metacritic.com/browse/games/score/userscore/all/ps4?sort=desc&page=", i), handle = curl::new_handle("useragent" = "Mozilla/5.0")))
- ps4_score[[i]] <- ps4 %>% html_nodes(xpath="//div[contains(@class, 'metascore_w')]/text()") %>% html_text()
- ps4_title[[i]] <- ps4 %>% html_nodes(xpath="//div[contains(@class, 'product_title')]/a/text()") %>% html_text()
- }
- ps4_score
- ps4_title
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement