python 下载CSV
时间: 2024-05-31 20:06:26 浏览: 128
在Python中下载CSV文件可以使用urllib库中的urlretrieve()方法来实现。以下是一个简单的示例代码:
```python
import urllib.request
url = "https://example.com/sample.csv"
filename = "sample.csv"
urllib.request.urlretrieve(url, filename)
```
以上代码将从指定的URL下载CSV文件,并将其保存在本地文件系统中。你只需要将上述代码中的“url”和“filename”替换为你要下载的CSV文件的URL和文件名即可。
阅读全文
相关推荐











