So I require hpricot, open-uri, and net/http in IRB. I type this bit of
code;
doc = Hpricot(open(“http://redhanded.hobix.com/index.html”))
then I run
images = (doc/“img”)
and I get this for images:
#<Hpricot::Elements[{emptyelem }, {emptyelem
}, {emptyelem
}, {emptyelem
}, {emptyelem
}, {emptyelem
}, {emptyelem
}, {emptyelem
}, {emptyelem
}, {emptyelem
}, {emptyelem
}, {emptyelem
}, {emptyelem
}, {emptyelem
}, {emptyelem
}, {emptyelem
}, {emptyelem
}]>
Now I want to be able to download all the images from this web page. But
I don’t see being able to just go (in psuedo code)
open(images[0], w) do |file|
write(images[0]
end
Because of all the weird ‘emptyelem’ bits. How do I get around these?