Python - 在没有链接的情况下在网站上下载 csv 文件 [英] Python - Download a csv file in website without link

查看:32
本文介绍了Python - 在没有链接的情况下在网站上下载 csv 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 python 下载 csv 文件时遇到问题.

I am having problem on downloading a csv file using python.

文件位置:https://www.hkex.com.hk/eng/sorc/options/statistics_hv_iv.aspx?ucode=00001

下载按钮导出到 csv"显示没有链接的 javascript.

The download button "export to csv" show javascript without a link.

如何下​​载文件?非常感谢!

How can I download the file? Thanks a lot!

推荐答案

从提供的 URL 中您无法直接提取下载链接.但是,下载 CSV 会产生以下 URL:https://www.hkex.com.hk/eng/sorc/options/statistics_hv_iv.aspx?action=csv&type=3&ucode=00001.使其可预测.

From the URL provided you cannot extract the download link directly. However, downloading the CSV yields the following URL: https://www.hkex.com.hk/eng/sorc/options/statistics_hv_iv.aspx?action=csv&type=3&ucode=00001. Making it predictable.

所以根据您的用例,您可以使用它吗?ucode 的值可以从您的第一个 url 的选择框中提取.

So depending on your usecase, you can use that? The values for ucode can be extracted from select box in your first url.

这篇关于Python - 在没有链接的情况下在网站上下载 csv 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆