[英]Is it possible to download a CSV file by using an Excel macro to click on a download button?
[英]Is there a way to download a CSV file from "website button click" without using RSelenium in R?
我必須單擊“Exportar lista completa de Fundos em CSV”按鈕來下載文件
出於某種原因,我可以閱讀 R 中的頁面的唯一方法是使用
url = "http://www.b3.com.br/pt_br/produtos-e-servicos/negociacao/renda-variavel/fundos-de-investimentos/fii/fiis-listados/"
download.file(url1, destfile = "scrapedpage.html", quiet=TRUE)
content <- read_html("scrapedpage.html")
“Exportar lista completa de Fundos em CSV”按鈕來自不同的來源,如果您在 chrome 上打開開發工具,您可以看到整個主體位於 iframe 中,其來源是https://sistemaswebb3-listados.b3。 com.br/fundsPage/7 。
我建議你
For this case it was https://sistemaswebb3-listados.b3.com.br/fundsProxy/fundsCall/GetListFundDownload/eyJ0eXBlRnVuZCI6NywicGFnZU51bWJlciI6MSwicGFnZVNpemUiOjIwfQ== this will csv data all you have to do is convert it to csv.
由於您可以輕松地從網站源獲取這些內容,因此您可以使用cheerio快速從 HTML 抓取項目
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.