Javascript httr后隐藏字段

Javascript httr后隐藏字段,javascript,r,web-scraping,Javascript,R,Web Scraping,为了搜集一些财务报表,我试图得到一份文件交付协议编号的列表 以下url具有指向给定公司的所有文档类别的链接 u1我认为您不需要会话cookie: library(httr) library(rvest) library(tidyverse) httr::POST( encode = "form", url = "http://siteempresas.bovespa.com.br/consbov/ExibeTodosDocumentosCVM.asp", query = list(

为了搜集一些财务报表,我试图得到一份文件交付协议编号的列表

以下url具有指向给定公司的所有文档类别的链接


u1我认为您不需要会话cookie:

library(httr)
library(rvest)
library(tidyverse)

httr::POST(
  encode = "form",
  url = "http://siteempresas.bovespa.com.br/consbov/ExibeTodosDocumentosCVM.asp",
  query = list(
    CNPJ = "09.414.761/0001-64",
    CCVM = "22446",
    TipoDoc = "C",
    QtLinks = "10"
  ),
  body = list(
    hdnCategoria = "IDI2",
    hdnPagina = "",
    FechaI = "",
    FechaV = ""
  )) -> res

content(res, encoding = "ISO-8859-1") %>%
  html_nodes("table")
## {xml_nodeset (21)}
##  [1] <table width="640" border="0" cellspacing="0" cellpadding="0" align ...
##  [2] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
##  [3] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
##  [4] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
##  [5] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
##  [6] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
##  [7] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
##  [8] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
##  [9] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
## [10] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
## [11] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
## [12] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
## [13] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
## [14] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
## [15] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
## [16] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
## [17] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
## [18] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
## [19] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
## [20] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
## ...
库(httr)
图书馆(rvest)
图书馆(tidyverse)
httr::POST(
encode=“form”,
url=”http://siteempresas.bovespa.com.br/consbov/ExibeTodosDocumentosCVM.asp",
查询=列表(
CNPJ=“09.414.761/0001-64”,
CCVM=“22446”,
TipoDoc=“C”,
QtLinks=“10”
),
body=列表(
hdnCategoria=“IDI2”,
hdnPagina=“”,
费猜=”,
FechaV=“”
))->res
内容(res,encoding=“ISO-8859-1”)%%>%
html_节点(“表”)
##{xml_nodeset(21)}
##  [1]
library(rvest)
s <- html_session(u1)
s %>% follow_link("DFP")
[1] Navigating to javascript:fVisualizaDocumentos('C','IDI2')
    Error in curl::curl_fetch_memory(url, handle = handle) : 
      Couldn't resolve host name
library(httr)
library(rvest)
library(tidyverse)

httr::POST(
  encode = "form",
  url = "http://siteempresas.bovespa.com.br/consbov/ExibeTodosDocumentosCVM.asp",
  query = list(
    CNPJ = "09.414.761/0001-64",
    CCVM = "22446",
    TipoDoc = "C",
    QtLinks = "10"
  ),
  body = list(
    hdnCategoria = "IDI2",
    hdnPagina = "",
    FechaI = "",
    FechaV = ""
  )) -> res

content(res, encoding = "ISO-8859-1") %>%
  html_nodes("table")
## {xml_nodeset (21)}
##  [1] <table width="640" border="0" cellspacing="0" cellpadding="0" align ...
##  [2] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
##  [3] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
##  [4] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
##  [5] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
##  [6] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
##  [7] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
##  [8] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
##  [9] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
## [10] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
## [11] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
## [12] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
## [13] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
## [14] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
## [15] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
## [16] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
## [17] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
## [18] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
## [19] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
## [20] <table width="95%" border="0" cellspacing="1" align="center" cellpa ...
## ...