library(httr2)
request_obj <- request("https://en.wikipedia.org/wiki/List_of_United_States_cities_by_population")
response_obj <- req_perform(request_obj)
# Parse HTML
library(xml2)
html_obj <- response_obj |> resp_body_html()
html_obj |> xml_find_all('//table[3]//td[1]') |> head(){xml_nodeset (6)}
[1] <td style="background-color:#cfecec">\n<i><a href="/wiki/New_York_City" t ...
[2] <td style="background-color:#cfecec">\n<i><a href="/wiki/Los_Angeles" tit ...
[3] <td style="background-color:#cfecec">\n<i><a href="/wiki/Chicago" title=" ...
[4] <td style="background-color:#cfecec">\n<i><a href="/wiki/Houston" title=" ...
[5] <td style="background-color:#ccff99">\n<i><b><a href="/wiki/Phoenix,_Ariz ...
[6] <td style="background-color:#cfecec">\n<i><a href="/wiki/Philadelphia" ti ...






