Screenshot of a particular area with Ruby and Selenium

Not currently possible

Selenium does not currently support clipping the viewport.

As a workaround, you can use the screenshot of a particular element and crop the image. You can also use an image manipulation tool to crop the image after it has been generated.

We created Urlbox to make converting HTML to images easy

Learn more about our website screenshot API.