library(robotstxt)
## Warning: package 'robotstxt' was built under R version 4.4.3

Question 5

url <- "https://en.wikipedia.org/wiki/2024_in_film"
permissions <- paths_allowed(url)
## Warning: package 'future' was built under R version 4.4.3
##  en.wikipedia.org
permissions
## [1] TRUE

Question 6

library(rvest)
## Warning: package 'rvest' was built under R version 4.4.3
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
url <- "https://en.wikipedia.org/wiki/2024_in_film"

page <- read_html(url)

tables <- page %>% html_elements("table.wikitable")


highest_grossing <- tables[[1]] %>% html_table(fill = TRUE)

head(highest_grossing)
## # A tibble: 6 × 4
##    Rank Title                 Distributor `Worldwide gross`
##   <int> <chr>                 <chr>       <chr>            
## 1     1 Inside Out 2          Disney      $1,698,863,816   
## 2     2 Deadpool & Wolverine  Disney      $1,338,073,645   
## 3     3 Moana 2               Disney      $1,059,242,164   
## 4     4 Despicable Me 4       Universal   $971,315,095     
## 5     5 Wicked                Universal   $756,535,681     
## 6     6 Mufasa: The Lion King Disney      $723,060,982