|
@@ -0,0 +1,25 @@
|
|
|
|
+package org.jeecg.modules.ctop.job;
|
|
|
|
+
|
|
|
|
+import org.openqa.selenium.WebDriver;
|
|
|
|
+import org.openqa.selenium.firefox.FirefoxDriver;
|
|
|
|
+import org.openqa.selenium.firefox.FirefoxOptions;
|
|
|
|
+import org.quartz.Job;
|
|
|
|
+import org.quartz.JobExecutionContext;
|
|
|
|
+import org.quartz.JobExecutionException;
|
|
|
|
+
|
|
|
|
+public class TestJob implements Job {
|
|
|
|
+ @Override
|
|
|
|
+ public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
|
|
|
+ System.setProperty("webdriver.gecko.driver", "/usr/lib/geckodriver");
|
|
|
|
+ FirefoxOptions options = new FirefoxOptions();
|
|
|
|
+ options.addArguments("--headless");
|
|
|
|
+ options.addArguments("--incognito");
|
|
|
|
+ options.addArguments("--no-sandbox");
|
|
|
|
+ options.addArguments("--disable-gpu");
|
|
|
|
+ options.addArguments("--window-size=1290,1080");
|
|
|
|
+ WebDriver driver = new FirefoxDriver(options);
|
|
|
|
+ driver.get("http://www.baidu.com");
|
|
|
|
+ System.out.println(driver.getPageSource());
|
|
|
|
+ driver.quit();
|
|
|
|
+ }
|
|
|
|
+}
|