# How to make webfetcher download images

**URL:** <https://www.ruby-forum.com/t/how-to-make-webfetcher-download-images/78601>\
**Category:** Ruby\
**Created:** [December 7, 2006, 6:05am UTC](https://www.ruby-forum.com/t/how-to-make-webfetcher-download-images/78601 "2006-12-07T06:05:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [December 7, 2006, 6:05am UTC](https://www.ruby-forum.com/t/how-to-make-webfetcher-download-images/78601/1 "2006-12-07T06:05:27Z")

</div>

The following script uses WebFetcher to recursively download html  
files. But the html pages are missing their jpg images. Any  
suggestions?

require ‘webfetcher’  
book =  
WebFetcher::Page.url(‘[Grass types](http://www.american-lawns.com/grasses/grasses.html#)’)  
book.recurse.save(‘grass’)

# save all files into a subfolder called grass.

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [December 7, 2006, 8:05am UTC](https://www.ruby-forum.com/t/how-to-make-webfetcher-download-images/78601/2 "2006-12-07T08:05:41Z")

</div>

never mind, i figured it out.

the jpg files were stored in a folder path that was at the same depth  
as the folder i was downloading. i’m guessing webfetcher will exclude  
those files.

so here’s the solution:

require ‘webfetcher’  
page = WebFetcher::Page.url(‘[http://www.american-lawns.com](http://www.american-lawns.com)’)  
page.recurse.save(‘grass’)
