首页 > 解决方案 > rvest 返回 schannel:SNI 或证书检查失败:SEC_E_WRONG_PRINCIPAL (0x80090322) - 目标主体名称不正确

问题描述

我想对以下页面进行网页抓取,以获得一个包含姓名和电子邮件列表的数据框。但是,以下代码在 open.connection(x, "rb") 中的 read_html 错误后返回以下错误:schannel:SNI 或证书检查失败:SEC_E_WRONG_PRINCIPAL (0x80090322) - 目标主体名称不正确。

r<-read_html("https://www.biologie.lmu.de/personen/index.html")
b<- r %>%
  html_nodes('td') %>%
  html_text()
b<-gsub("  ", "", b)
b<-gsub('\n\n\n\n\n\n', '_', b, fixed = T)
b<-gsub('\n', '', b, fixed = T)
w<-which(grepl('@', b))
d<-data.frame(matrix(b, ncol=w[1], byrow=T),stringsAsFactors=FALSE)
d<-data.frame(people_name=d$X1, people_links=NA, emails=d[,w[1]], university="LMU Munich" )

PS 当我从浏览器进入网站时,它说连接不安全

标签: rweb-scrapingrvest

解决方案


推荐阅读