Rによる自動データ収集

By estis , 13 5月, 2018

p.320

geckodriver-v0.20.1-macos.tar.gz から、ドライバーをインストールして、

serverDetails$value[[1]] でエラー: 添え字が許される範囲外です

というエラーはなくなったけれど、

java -jar selenium-server-standalone-3.12.0.jar
したコンソールに、

By estis , 10 5月, 2018

p.6 の
yend_clean <- unlist(str_extract_all(danger_table$yend, "[[:digit:]]{4}$")) は、
現在の https://en.wikipedia.org/wiki/List_of_World_Heritage_in_Danger から読み込んだデータだと、
str_extract_all(danger_table$yend, "[[:digit:]]{4}$") で期待する値が取れない。
2001–
のように、「–」があるためだ。
なので、

> yend_clean  <- str_extract_all(danger_table$yend, "[[:digit:]]{4}–$")
> danger_table$yend <- as.numeric(str_sub(yend_clean, 1, 4))

した。

By estis , 9 5月, 2018

『Rによる自動データ収集』p.4 では、
htmlParse 関数によるWebページの読み込みが記載されているが、訳注にあるようにHTTPSに対応していない。
翻訳サポートサイトでは、RCurl パッケージを用い、
htmlParse(getURL("https://~"))
としているが、
rvest パッケージを用い、
htmlParse(read_html("https://~"))
とすることもできる。