R语言爬虫 rvest包 html_text()-html_nodes() 原理说明

时间:2023-03-09 17:14:33
R语言爬虫 rvest包  html_text()-html_nodes() 原理说明
library(rvest) 

  例子网页:http://search.51job.com/jobsearch/search_result.php?fromJs=1&jobarea=010000%2C00&funtype=0000&industrytype=00&keyword=%E6%95%B0%E6%8D%AE&keywordtype=2&lang=c&stype=2&postchannel=0000&fromType=1&confirmdate=9

网页源文件(部分):

R语言爬虫 rvest包  html_text()-html_nodes() 原理说明

要爬虫的数据:职位名、公司名、薪资、工作地点、发布时间。

读入网页

R语言爬虫 rvest包  html_text()-html_nodes() 原理说明

测试html_nodes():节点 p.t1  span.t2  span.t3 span.t4 span.t5R语言爬虫 rvest包  html_text()-html_nodes() 原理说明

测试html_text()

R语言爬虫 rvest包  html_text()-html_nodes() 原理说明