2011-07-26 72 views

回答

3
wget -r -l1 -A.pdf http://www.abc.com/pdf/books 
+2

这只适用于'http:// www.abc.com/pdf/books'导致包含指向PDF文件链接的页面。 – Job

+0

暗示:“假设我有一个可通过http_访问的_directory”。如果Web服务器没有为图像文件夹启用目录浏览,则此方法将失败,是的。 – merryprankster

2

从wget的手册页:

Wget can follow links in HTML and XHTML pages and create local versions of remote web sites, fully recreating the directory structure of the original site. This is 
    sometimes referred to as ``recursive downloading.'' While doing that, Wget respects the Robot Exclusion Standard (/robots.txt). Wget can be instructed to convert the 
    links in downloaded HTML files to the local files for offline viewing. 

Recursive Retrieval Options 
-r 
    --recursive 
     Turn on recursive retrieving. 

    -l depth 
    --level=depth 
     Specify recursion maximum depth level depth. The default maximum depth is 5. 
0

这取决于网络服务器和服务器的配置。严格来说,URL不是一个目录路径,所以http://something/books/*是没有意义的。

但是如果Web服务器实现的http://something/books路径是上市网站上所有的图书索引页面,那么你就可以玩的recursive option和蜘蛛的选择和wget会很乐意跟着这在任何链接http://something/books索引页面。