【问题标题】:make wget download a file directly to disk from bash使 wget 从 bash 直接下载文件到磁盘
【发布时间】:2014-03-23 09:15:00
【问题描述】:

在网站上,使用我的凭据登录后,我可以通过将 url 地址更改为以下变体来下载 daa:

https://data.somewhere.com/DataDownload/getfile.jsp?ccy=AUDUSD&df=BBO&year=2014&month=02&dllater=Download

这会在我的下载目录中放置一个 zip 文件。

如果我尝试使用 wget 自动化它:

wget "https://data.somewhere.com/DataDownload/getfile.jsp?ccy=AUDUSD&df=BBO&year=2014&month=02&dllater=Download" --no-check-certificate --ignore-length

$ ~/dnloadHotSpot.sh

--2014-03-22 16:05:16--  https://data.somewhere.com/DataDownload/getfile.jsp?ccy=AUDUSD&df=BBO&year=2014&month=02&dllater=Download
Resolving data.somewhere.com (data.somewhere.com)... 209.191.250.173
Connecting to data.somewhere.com (data.somewhere.com)|209.191.250.173|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: ignored [text/html]
Saving to: `getfile.jsp@ccy=AUDUSD&df=BBO&year=2014&month=02&dllater=Download'

    [ <=>                                                                                                                                                               ] 8,925       --.-K/s   in 0.001s

2014-03-22 16:05:18 (14.4 MB/s) - `getfile.jsp@ccy=AUDUSD&df=BBO&year=2014&month=02&dllater=Download' saved [8925]

为了让 wget 真正下载文件,我还需要添加什么?

【问题讨论】:

    标签: wget


    【解决方案1】:

    如果要指定 wget 正在下载的文件内容所在的输出文件的名称,则使用大写的 O 参数,例如:

    wget -O myfilename ......
    

    【讨论】:

    • 但是这个 url 链接会导致下载 - 这不是我想要的网络内容。还是我用错了?
    猜你喜欢
    • 2020-11-27
    • 2014-06-21
    • 1970-01-01
    • 1970-01-01
    • 2013-04-29
    • 1970-01-01
    • 2015-09-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多