Please install the rvest package first.

library(rvest)
## Warning: package 'rvest' was built under R version 4.1.2

Get the HTML source file from the webpage:

url = "https://ocw.mit.edu/courses/most-visited-courses/"
webpage = read_html(url, encoding = "UTF-8")

Find and print the text information:

course_nodes <- html_nodes(webpage,xpath = '//tr[@class="odd" or @class="even"]/td/a')
for (node in course_nodes)
  print(html_text(node))
## [1] "6.0001"
## [1] "Introduction to Computer Science and Programming in Python"
## [1] "Undergraduate"
## [1] "6.006"
## [1] "Introduction to Algorithms"
## [1] "Undergraduate"
## [1] "15.S12"
## [1] "Blockchain and Money"
## [1] "Graduate"
## [1] "18.01SC"
## [1] "Single Variable Calculus"
## [1] "Undergraduate"
## [1] "18.06"
## [1] "Linear Algebra"
## [1] "Undergraduate"
## [1] "6.006"
## [1] "Introduction to Algorithms"
## [1] "Undergraduate"
## [1] "18.02SC"
## [1] "Multivariable Calculus"
## [1] "Undergraduate"
## [1] "8.01SC"
## [1] "Classical Mechanics"
## [1] "Undergraduate"
## [1] "18.06SC"
## [1] "Linear Algebra"
## [1] "Undergraduate"
## [1] "6.042J"
## [1] "Mathematics for Computer Science"
## [1] "Undergraduate"
## [1] "6.042J"
## [1] "Mathematics for Computer Science"
## [1] "Undergraduate"
## [1] "18.05"
## [1] "Introduction to Probability and Statistics"
## [1] "Undergraduate"
## [1] "18.01"
## [1] "Single Variable Calculus"
## [1] "Undergraduate"
## [1] "18.03SC"
## [1] "Differential Equations"
## [1] "Undergraduate"
## [1] "6.00SC"
## [1] "Introduction to Computer Science and Programming"
## [1] "Undergraduate"
## [1] "Supplemental"
## [1] "Signals and Systems"
## [1] "Undergraduate"
## [1] "18.S096"
## [1] "Topics in Mathematics with Applications in Finance"
## [1] "Undergraduate"
## [1] "8.04"
## [1] "Quantum Physics I"
## [1] "Undergraduate"
## [1] "6.0002"
## [1] "Introduction to Computational Thinking and Data Science"
## [1] "Undergraduate"
## [1] "14.01"
## [1] "Principles of Microeconomics"
## [1] "Undergraduate"