【发布时间】:2021-04-29 08:46:52
【问题描述】:
我正在学习如何填写表格并在 R 中使用rvest 提交,当我想在 stackoverflow 中搜索 ggplot 标记时我被卡住了。这是我的代码:
url<-"https://stackoverflow.com/questions"
(session<-html_session("https://stackoverflow.com/questions"))
(form<-html_form(session)[[2]])
(filled_form<-set_values(form, tagQuery = "ggplot"))
searched<-submit_form(session, filled_form)
我遇到了错误:
Submitting with '<unnamed>'
Error in parse_url(url) : length(url) == 1 is not TRUE
关注这个问题 (rvest error on form submission) 我尝试了几种方法来解决这个问题,但我不能:
filled_form$fields[[13]]$name<-"submit"
filled_form$fields[[14]]$name<-"submit"
filled_form$fields[[13]]$type<-"button"
filled_form$fields[[14]]$type<-"button"
任何帮助家伙
【问题讨论】: