HTMLを読み込む
次のウェブサイトの抜粋を見てみましょう。
Web Scraping is cool
It involves writing code – be it R or Python.
DataCamp has courses on it.
対応するHTMLは、
html_excerpt_raw という変数に用意されています。
この演習では、rvest を使ってそれをRに読み込み、操作できるようにします。
このコース全体を通して rvest パッケージを使用するため、library(rvest) コマンドで常に事前に読み込まれています。
この演習はコースの一部です
Rで学ぶWebスクレイピング
実践的なインタラクティブ演習
このサンプルコードを完成させて、この演習に挑戦してみましょう。
html_excerpt_raw <- '
Web scraping is cool
It involves writing code – be it R or Python.
DataCamp
has courses on it.
'
# Turn the raw excerpt into an HTML document R understands
html_excerpt <- ___
html_excerpt