0
rvestを使用してwikipediaからHTMLテーブルを削っています。 リンクを含むセルがあるたびに、実際のテキストを取得し、html_table()を実行した後、Rデータフレーム内のリンクの名前を取得します。rvest wikipediaリンクを含むセルを複製すると重複が発生する
ここは例です。私はだけではなく、「Jannings、EmilEmilの例えば、「Jannings、エミール」、名前を持っていることを好むだろう
dplyr::glimpse(males)
Observations: 91
Variables: 9
$ `#` <chr> "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "1...
$ Actor <chr> "Jannings, EmilEmil Jannings", "Baxter, WarnerWarner Baxter...
$ Film <chr> "The Way of All Flesh and The Last CommandThe Last Command,...
$ `Date of birth` <chr> "1884-07-23(1884-07-23)July 23, 1884", "1889-03-29(1889-03-...
$ `Date of award` <chr> "May 16, 1929 (1929-05-16)", "April 3, 1930 (1930-04-03)", ...
$ `Age upon\nreceiving award` <chr> "44-2977004163670000000000♠44 years, 297 days", "41-0057004...
$ `Date of death` <chr> "1950-01-02(1950-01-02)January 2, 1950", "1951-05-07(1951-0...
$ Lifespan <chr> "23,903 days (7004239030000000000♠65 years, 163 days)", "22...
$ Notes <chr> "Held record as oldest winner for 2 award ceremonies (from ...
:俳優の名前が繰り返されたデータフレームを生成
males_raw <- read_html("https://en.wikipedia.org/wiki/List_of_Academy_Award_Best_Actor_winners_by_age")
males <- males_raw %>%
html_nodes(xpath='//*[@id="mw-content-text"]/div/table') %>%
html_table()
males <- males[[1]]
Jannings "
ありがとう!