Question: I'm beginning to use to the ruby programming language. I have a ruby script to crawl pdf files on page with anemone:

```
Anemone.crawl("http://example.com") do |anemone|
  anemone.on_pages_like(/\b.+.pdf/) do |page|
    puts page.url
  end
end

```

I want download page.url using gem ruby. What gem can I use to download page.url?

Answer: 
No need for an extra gem, try this

```
require 'anemone'

Anemone.crawl("http://www.rubyinside.com/media/",:depth_limit => 1, :obey_robots_txt => true, :skip_query_strings => true) do |anemone|
  anemone.on_pages_like(/\b.+.pdf/) do |page|
    begin
      filename = File.basename(page.url.request_uri.to_s)
      File.open(filename,"wb") {|f| f.write(page.body)}
      puts "downloaded #{page.url}"
    rescue
      puts "error while downloading #{page.url}"
    end
  end
end

```

gives

```
downloaded http://www.rubyinside.com/media/poignant-guide.pdf

```

and the pdf is fine.
If you're on a UNIX system, maybe [`UnixUtils`](https://github.com/seamusabshere/unix_utils):

```
Anemone.crawl("http://example.com") do |anemone|
  anemone.on_pages_like(/\b.+.pdf/) do |page|
    puts page.url            # => http://example.com/foo.bar
    puts UnixUtils.curl(url) # => /tmp/foo.bar.1239u98sd
  end
end

```