【发布时间】:2022-01-26 00:31:38
【问题描述】:
我有一个网站列表,我的目标是检查每个网站的状态代码。我有以下内容,其中urls 是网站列表。
for (i in seq_along(urls)) {
r <- GET(test[i])
s <- status_code(r)
}
当我运行 for 循环时,我收到以下消息:
Error in curl::curl_fetch_memory(url, handle = handle) : schannel: SNI or certificate check failed: SEC_E_WRONG_PRINCIPAL (0x80090322) - The target principal name is incorrect.
我正在考虑使用 tryCatch 处理这个问题,但我不确定语法或是否将整个 for 循环放在 tryCatch 中。
【问题讨论】:
标签: r dataframe for-loop error-handling http-status-codes