From: Ahmed A. <asa...@ya...> - 2015-09-29 20:42:07
|
Hi, { HtmlUnitWebElement webElement = (HtmlUnitWebElement) driver.findElement(By.id("abcd")); HtmlImage htmlImage = get(webElement, "element"); htmlImage.saveAs(file); // or ImageReader reader = htmlImage.getImageReader(); } @SuppressWarnings("unchecked") private static <T> T get(final Object o, final String fieldName) throws Exception { final Field field = o.getClass().getDeclaredField(fieldName); field.setAccessible(true); return (T) field.get(o); } Thanks,Ahmed From: "htm...@li..." <htm...@li...> To: htm...@li... Sent: Tuesday, September 29, 2015 7:57 PM Subject: Auto-discard notification ----- Forwarded Message ----- The attached message has been automatically discarded.Hello Ahmed, I have subscribed to the list before posting?!? Thank you for your suggestion, works nearly perfect. My issue now is I am getting the full downloaded page including all file types, except images. How can I tell one of both (HtmlUnit or Selenium) to download the images as well? |