SaveElementImage - web automation method

Not available in Open Twebst edition!
Scrap the image an HTML element from a web site and save it to a graphic file (BMP, GIF, JPG, PNG).

Applies to:
This web scraping method extracts the image (as it appears on the screen) of an HTML element and saves it to a specified graphic file. The supported image file formats are: BMP, GIF, JPG, PNG. An extension for the image file name must be provided. In case of an error, a web macro exception is thrown and the lastError property is set to FAIL_ERROR.
// Save all the existing images in a web page.
var coreObj = new ActiveXObject("Twebst.Core");
var browser = coreObj.StartBrowser("");

var images = browser.FindAllElements("img");
for (i = 0; i < images.length; ++i)
	images(i).SaveElementImage("c:\\img" + i + ".jpg");
See also:
Element | Highlight

© 2014 CodeCentrix Software. All rights reserved.