找回密码
 注册
搜索
[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
查看: 28507|回复: 9

[网络连接] [已解决]如何使用wget命令保存网页

[复制链接]
发表于 2019-8-3 13:24:27 | 显示全部楼层 |阅读模式
本帖最后由 impk 于 2019-8-4 12:26 编辑

想用wget 把网页内容保存为hosts.htm或hosts.txt
网址为 https://raw.githubusercontent.co ... r/hosts-files/hosts
这个wget命令应该怎么写?
 楼主| 发表于 2019-8-3 13:25:28 | 显示全部楼层
本帖最后由 impk 于 2019-8-3 14:15 编辑

已下载wget并设置环境变量,现在CMD中可以使用wget
发表于 2019-8-3 14:41:01 | 显示全部楼层
wget有帮助,自己看 wget --help
wget -O hosts.txt https://raw.githubusercontent.co ... r/hosts-files/hosts

评分

参与人数 1技术 +1 收起 理由
impk + 1 谢了

查看全部评分

 楼主| 发表于 2019-8-3 14:50:17 | 显示全部楼层
本帖最后由 impk 于 2019-8-3 14:59 编辑
wget有帮助,自己看 wget --help
wget -O hosts.txt  ... r/hosts-files/hosts
flashercs 发表于 2019-8-3 14:41



我看过帮助文件和网上的教程,跟我自己机器上的运行结果对不起来

比如这个命令【wget -O hosts.txt https://raw.githubusercontent.co ... r/hosts-files/hosts
运行结果是下面这样,生成hosts.txt文件为0kb

C:\>wget -O hosts.txt https://raw.githubusercontent.com/googlehosts/hosts/master
/hosts-files/hosts
--14:42:55--  ftp://https:21/%2Fraw.githubusercontent.com/googlehosts/hosts/mast
er/hosts-files/hosts
           => `hosts.txt'
Connecting to https:21...
https: Host not found
发表于 2019-8-3 15:20:36 | 显示全部楼层
回复 4# impk
 楼主| 发表于 2019-8-3 15:30:19 | 显示全部楼层
回复  impk
flashercs 发表于 2019-8-3 15:20



    可能是我操作系统有问题
发表于 2019-8-3 15:32:47 | 显示全部楼层
  1. wget --no-check-certificate -O hosts.txt https://raw.githubusercontent.com/googlehosts/hosts/master/hosts-files/hosts
复制代码
 楼主| 发表于 2019-8-3 15:37:16 | 显示全部楼层
cfwyy77_bat 发表于 2019-8-3 15:32



    Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.

C:\Documents and Settings\Administrator>cd\

C:\> wget --no-check-certificate -O hosts.txt https://raw.githubusercontent.com/
googlehosts/hosts/master/hosts-files/hosts
wget: unrecognized option `--no-check-certificate'
Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.
发表于 2019-8-3 15:43:59 | 显示全部楼层
你的wget版本有问题,下载 : http://bcn.bathome.net/tool/1.19.4/wget.exe
 楼主| 发表于 2019-8-3 15:48:47 | 显示全部楼层
你的wget版本有问题,下载 :
flashercs 发表于 2019-8-3 15:43



    换了你这个版本wget后下载成功,多谢
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|批处理之家 ( 渝ICP备10000708号 )

GMT+8, 2026-3-19 06:18 , Processed in 0.019368 second(s), 8 queries , File On.

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表