我正在寻找使用python从remove服务器下载文件的最快方法。这里的问题是我没有直接链接到这个文件(例如。example.com/document1.pdf),但该文件是通过在html页面中使用内容处置头强制下载的。你知道吗
我正在尝试从以下网站下载公开可用的PDF:http://www.et.gr/idocs-nph/search/fekForm.html
现在,我的解决方案是使用selenium
访问下载页,然后在保存到我的计算机上后重命名该文件,这需要很多时间。我想知道是否有更好的方法,一些不需要webdrivers和下载远程文件,在每个页面被服务的速度要快得多。你知道吗
看起来像:
import requests
response = requests.get('www.example.com/download.html')
headers = response.headers;
# Do something with content-disposition header to download the file
目前没有回答
相关问题 更多 >
编程相关推荐