简体   繁体   English

无法使用wget下载网站内容

[英]Unable to download website content with wget

I am failing to download the below website using wget in bash: 我无法在bash中使用wget下载以下网站:

wget --wait 1 -x -H -mk https://bittrex.com/api/v1.1/public/getorderbook?market=usdt-btc&type=sell

I have found some similar issues in other questions, however, their solution was to use -mk , which makes no difference here. 我在其他问题中发现了一些类似的问题,但是,他们的解决方案是使用-mk ,在这里没有什么区别。 The prompt just freeze after the command and nothing happens. 该提示仅在命令后冻结,并且没有任何反应。 If I try to open the same website in a browser, it will open normally. 如果我尝试在浏览器中打开同一网站,它将正常打开。 I would be grateful for any help here. 我将不胜感激。

As already pointed out in a comment, you need to quote your URL. 正如评论中已经指出的那样,您需要引用URL。

The & in the URL is putting wget --wait 1 -x -H -mk https://bittrex.com/api/v1.1/public/getorderbook?market=usdt-btc into the background and causes everything after the & to be interpreted as a command, which can be a great risk depending on the URL! URL中的&wget --wait 1 -x -H -mk https://bittrex.com/api/v1.1/public/getorderbook?market=usdt-btc放入后台,并导致&之后的所有内容被解释为命令,根据URL 可能会有很大的风险

If your URL contains a $ you should use single-quotes ( ' ) to pass the string literally without variable expansion, otherwise double quotes ( " ) are fine. 如果您的URL包含$ ,则应使用单引号( ' )逐字传递字符串,而不进行变量扩展,否则双引号( " )可以。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM