相关疑难解决方法(0)

在Bash中并行wget

我从一个网站得到一堆相对较小的页面,并想知道我是否可以在Bash中以某种方式并行执行.目前我的代码看起来像这样,但执行需要一段时间(我认为减慢我的速度是连接中的延迟).

for i in {1..42}
do
    wget "https://www.example.com/page$i.html"
done
Run Code Online (Sandbox Code Playgroud)

我听说过使用xargs,但我对此一无所知,而且手册页非常混乱.有任何想法吗?甚至可以并行执行此操作吗?还有另一种方法可以攻击这个吗?

parallel-processing bash wget

70
推荐指数
4
解决办法
5万
查看次数

使用多个连接使用wget下载文件

如何使用多个连接下载wget文件,其中每个连接下载文件的一部分?

linux wget download

17
推荐指数
2
解决办法
2万
查看次数

如何使用 --accept-regex 选项通过 wget 下载网站?

我想下载我的网站的档案-  3dsforums.com -使用wget,但现在有成千上万的网页我希望下载,所以我想告诉wget来匹配特定的URL模式,只有下载页面,但我遇到了一些障碍。

例如,这是我要下载的 URL:

http://3dsforums.com/forumdisplay.php?f=46

...所以我尝试使用该--accept-regex选项:

wget -mkEpnp --accept-regex "(forumdisplay\.php\?f=(\d+)$)" http://3dsforums.com
Run Code Online (Sandbox Code Playgroud)

但它只是下载网站的主页。

到目前为止,远程工作的唯一命令如下:

wget -mkEpnp --accept-regex "(\w+\.php$)" http://3dsforums.com
Run Code Online (Sandbox Code Playgroud)

这提供了以下响应:

Downloaded 9 files, 215K in 0.1s (1.72 MB/s)
Converting links in 3dsforums.com/faq.php.html... 16-19
Converting links in 3dsforums.com/index.html... 8-88
Converting links in 3dsforums.com/sendmessage.php.html... 14-15
Converting links in 3dsforums.com/register.php.html... 13-14
Converting links in 3dsforums.com/showgroups.php.html... 14-29
Converting links in 3dsforums.com/index.php.html... 16-80
Converting links in 3dsforums.com/calendar.php.html... 17-145
Converting links in 3dsforums.com/memberlist.php.html... 14-99
Converting links in 3dsforums.com/search.php.html... 15-16
Converted links in …
Run Code Online (Sandbox Code Playgroud)

regex wget

4
推荐指数
1
解决办法
5215
查看次数

标签 统计

wget ×3

bash ×1

download ×1

linux ×1

parallel-processing ×1

regex ×1