[问题] 使用 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