|
@@ -1,27 +1,23 @@
|
|
|
package com.qunzhixinxi.hnqz.admin.util;
|
|
|
|
|
|
-import org.openqa.selenium.*;
|
|
|
-import org.openqa.selenium.chrome.ChromeDriver;
|
|
|
-import org.openqa.selenium.chrome.ChromeOptions;
|
|
|
-import org.openqa.selenium.phantomjs.PhantomJSDriver;
|
|
|
-import org.openqa.selenium.phantomjs.PhantomJSDriverService;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.openqa.selenium.Dimension;
|
|
|
+import org.openqa.selenium.JavascriptExecutor;
|
|
|
import org.openqa.selenium.remote.DesiredCapabilities;
|
|
|
import org.openqa.selenium.remote.RemoteWebDriver;
|
|
|
import org.openqa.selenium.support.ui.WebDriverWait;
|
|
|
import ru.yandex.qatools.ashot.AShot;
|
|
|
import ru.yandex.qatools.ashot.Screenshot;
|
|
|
import ru.yandex.qatools.ashot.coordinates.WebDriverCoordsProvider;
|
|
|
-//import sun.misc.BASE64Decoder;
|
|
|
|
|
|
-import javax.imageio.ImageIO;
|
|
|
import java.awt.image.BufferedImage;
|
|
|
-import java.io.*;
|
|
|
+import java.io.IOException;
|
|
|
import java.net.MalformedURLException;
|
|
|
import java.net.URL;
|
|
|
-import java.util.List;
|
|
|
-import java.util.UUID;
|
|
|
-import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
+//import sun.misc.BASE64Decoder;
|
|
|
+
|
|
|
+@Slf4j
|
|
|
public class Html2ImageByJsWrapper {
|
|
|
|
|
|
// public static String SERVER_URL="192.168.43.131";
|
|
@@ -54,7 +50,7 @@ public class Html2ImageByJsWrapper {
|
|
|
|
|
|
|
|
|
public static BufferedImage renderHtml2Image(String url,String serverUrl) throws IOException {
|
|
|
- System.out.println("url:"+url);
|
|
|
+ log.info("url: {}", url);
|
|
|
|
|
|
DesiredCapabilities dc = DesiredCapabilities.chrome();
|
|
|
try {
|