1

I trying to find a way to save a remote image with a headless browser (like PhantomJs using poltergeist) on ruby.

I dont need to save image using "net::http", or "uri.parse open".

I'm looking just saving an image with a headless browser on ruby.

I looked all over the web and also asked on irc chat but there is no one who knows to save an image with headless browser on rails.

Thanks in advance.

1
  • It can't be done directly unless the driver supports it (which it probably doesn't) Dec 5, 2015 at 1:16

1 Answer 1

0

You may save part of webpage with poltergeist which is extension on top of phantomjs.

From poltergeist documentation:

save_screenshot('/path/to/file.png', :selector => '#id')

However, poltergeist is supposed to work under capybara, not sure if you can adopt it for your use (your tags says you know about poltergeist).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.