0

My goal is to exact urls from a wiki page and there is a table of congress members and I want to exact their own wiki urls.

My input is like:

url_congress <- "https://en.wikipedia.org/wiki/List_of_current_United_States_senators"
mynodes <- html_node(congress, ".fn a")
urls <- html_attr(mynodes, name = "href")
urls

However, it only selected the first url instead of all urls:

[1] "/wiki/Richard_Shelby"

What should I do if I want to select all urls in the table?

a111ex
  • 23
  • 3

1 Answers1

1

I should change the code to html_nodes instead of html_node !

a111ex
  • 23
  • 3