[問題] 使用 rvest 套件,爬不出表格內容

作者: lusa (茹莎)   2016-07-07 11:57:55
想要使用 rvest套件,爬出此網頁的table
此網頁:http://app.tzuchi.com.tw/tzuchi/About_TP_Center/?ContentType=6&IdentityID=130
剛申請進入這裡,第一次發文
小妹初步學習R語言,希望淺顯易懂,能夠更加了解使用方法。
程式碼如下:
library(rvest)
webpage <-
html("http://app.tzuchi.com.tw/tzuchi/About_TP_Center/?ContentType=6&IdentityID=130")
webpage <- iconv(webpage,from="UTF-8",to="UTF-8")
data <- webpage %>% html_nodes("table[@id='table15']") %>% .[[1]] %>% html_table()
使用這樣程式碼卻爬不出來,是甚麼原因呢?
跑出錯誤訊息是:
Error in UseMethod("xml_find_all") :
no applicable method for 'xml_find_all' applied to an object of class
"character"
作者: howard40116   2016-07-07 13:11:00
html_nodes("#table15")
作者: celestialgod (天)   2016-07-07 21:06:00

Links booklink

Contact Us: admin [ a t ] ucptt.com