This recipe introduces the
clipRect property on
webpage instances, and it describes its role in rendering portions of our web page content. The recipe also illustrates how to set the property dynamically (for example, to capture specific page elements).
To run this recipe, we will need a script that accesses a web page. We need some knowledge of the structure of the target web page so that we can define a selector to use for further targeting specific content on that web page. We also need write permissions to the filesystem in that script's working directory.
The script in this recipe is available in the downloadable code repository as
chapter07. If we run the provided ...