Tools to Capture and Convert the Web

Take screenshots without popups!

18 February 2017

Over the coming weeks we are going to start rolling out an update to our API's that allows you to hide HTML elements. This will be especially useful for hiding those annoying inline modal popups that some websites use to encourage users to perform actions.

So far the changes have been rolled out to the following API's:

To hide HTML elements, just simply specify the id's or class names of all the HTML elements you wish to hide. For instance #myelem, .myclass. Below is two examples of doing this using both JavaScript and PHP.

Hiding HTML elements using JavaScript

GrabzIt("Sign in to view your Application Key").ConvertURL("http://www.google.com", {"hide":"#myelem, .myclass"}).Create();

Hiding HTML elements using PHP

$grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
$options = new GrabzItImageOptions();
$options->setHideElement("#myelem, .myclass");

$grabzIt->URLToImage("http://www.google.com", $options);
$grabzIt->SaveTo("test.jpg");

Additionally the target parameter, now accepts class names in addition to identifiers, just specify the standard CSS selector. Just pass one CSS selector to the target parameter so for instance .myclass or #myid If there are multiple matching elements the first one will be chosen.

View the latest blog posts