我有一些经验,但没有网站编码经验,并且认为我无法选择正确的 CSS 节点进行解析(我相信)。
library(rvest)
library(xml2)
library(selectr)
library(stringr)
library(jsonlite)
url <-'https://scholar.google.com/scholar?hl=en&as_sdt=0%2C38&q=apex+predator+conservation&btnG=&oq=apex+predator+c'
webpage <- read_html(url)
title_html <- html_nodes(webpage, 'a#rh06x-YUUvEJ')
title <- html_text(title_html)
head(title)
Run Code Online (Sandbox Code Playgroud)
最终,如果我可以将所有学者成果抓取并分成一个 csv 文件,其中包含“标题”、“作者”、“年份”、“期刊”等标题,那就太好了。任何帮助将非常感激!谢谢