library(rvest)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(xml2)
url <- "https://en.wikipedia.org/wiki/2026_in_film"
# Force UTF-8 encoding (fixes the error)
page <- read_html(url, encoding = "UTF-8")
tables <- html_elements(page, "table") |> html_table(fill = TRUE)
length(tables)
## [1] 7
highest <- tables[[3]]
highest
## # A tibble: 10 × 4
## Rank Title Distributor `Worldwide gross`
## <int> <chr> <chr> <chr>
## 1 1 Cheburashka 2 † Central Partnership $79,559,272
## 2 2 28 Years Later: The Bone Temple † Sony $56,794,677
## 3 3 Send Help † 20th Century Studi… $55,900,522
## 4 4 Border 2 † AA Films $51,204,000[3]
## 5 5 Mercy † Amazon MGM Studios… $49,994,297
## 6 6 Iron Lung † Markiplier Studios $42,434,920
## 7 7 Return to Silent Hill † Iconic Events Rele… $41,586,056[4]
## 8 8 Primate † Paramount Pictures $39,722,402
## 9 9 Dracula † SND (France) $33,618,925
## 10 10 Mana Shankara Vara Prasad Garu † Gold Box Entertain… $32,225,000[5][6]