上传者: qq_36813206
|
上传时间:2025/3/19 18:30:24
|
文件大小:4KB
|
文件类型:R
R语言爬取网页数据,并进行整理归类
主要是通过R语言,对网页上的数据进行进行爬取,并且整理成文本格式,或者excel格式。
Sys.setlocale("LC_TIME","C")##[1]"C"-----------------------------------------------------------##Createafunction,theparameter'i'meanspagenumber.getdata%html_nodes("div.post_itemdiv.post_item_foot")%>%html_text()%>%strsplit(split="\r\n")#对日期数据的处理-------------------------------------------------------------post_date%str_sub(9,24)%>%as.POSIXlt()##getthedatepost_year%html_nodes("div.post_itemh3")%>%html_text()%>%as.character()%>%trim()
本软件ID:9957748