作者vicror84 (阿汘)
看板R_Language
标题[问题] 储存格问题
时间Sun Jun 5 20:27:35 2016
原网址:
http://www.mmh.org.tw/health/image/exam_services/exam_services.html
R语言程式:
library(XML)
URL =
paste0("
http://www.mmh.org.tw/health/image/exam_services/exam_services.html")
Sys.sleep(runif(1,1,2))
doc<-htmlParse(URL,encoding="UTF-8")
tables<-readHTMLTable(doc,header=F,which = 2)
tables
dim(tables)
有些资料原本在右边,但爬出来後出现在左边
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 114.42.187.234
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/R_Language/M.1465129670.A.0C1.html
1F:→ celestialgod: 你前一个文章的网址表格也会这样 06/05 21:09
2F:→ celestialgod: 这个要自己手动处理 06/05 21:09
3F:→ celestialgod: 就参考我的回文即可 06/05 21:09