library('rvest')
url<-'https://movie.douban.com/subject/2378019/'
web<-read_html(url)
total=web%>% html_nodes('span a')
name=total%>% html_text()
total1=web%>% html_nodes('span span')
assemnet=total%>% html_text()
total2=web%>% html_nodes('p span')
content=total%>% html_text()
write.csv(data.frame(name,assemnet,content),'C:/Rdata',row.names=FALSE)
源代码内容是这样的但是运行完最后一行出现这样的报错(这个报错看了好几天没看懂)
Error in file(file, ifelse(append, "a", "w")) :
cannot open the connection
In addition: Warning message:
In file(file, ifelse(append, "a", "w")) :
cannot open file 'C:/Rdata': Permission denied