package club.magicfun.aquila.job;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class QuartzJob  {

	public QuartzJob() {
		System.out.println("Quartzjob创建成功");
	}
	
	@Scheduled(cron = "0/30 * *  * * ? ")
    public void run(){
        System.out.println("Quartz执行的任务调度");
        
        WebDriver webDriver = new ChromeDriver();
        
        //webDriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
        
        webDriver.get("https://item.taobao.com/item.htm?id=43462858898"); 
  
        System.out.println("title: " + webDriver.getTitle());
        
        webDriver.close();  
        webDriver.quit();
    }

}

@@ -28,16 +28,78 @@
 a.job;%0A%0A
+import java.util.List;%0Aimport java.util.concurrent.TimeUnit;%0A%0A
 import o
@@ -486,15 +486,14 @@
  %220/
-30
+15
  * *
- 
  * *
@@ -626,32 +626,116 @@
 ver();%0A        %0A
+        webDriver.get(%22https://item.taobao.com/item.htm?id=43462858898%22); %0A        %0A
         //webDri
@@ -777,10 +777,9 @@
 ait(
-30
+5
 , Ti
@@ -816,77 +816,633 @@
     
-webDriver.get(%22https://item.taobao.com/item.htm?id=43462858898%22); %0A  
+System.out.println(%22title: %22 + webDriver.getTitle());%0A  %0A        List%3CWebElement%3E colorCategoryList = webDriver.findElements(By.xpath(%22//*%5B@data-property='%E9%A2%9C%E8%89%B2%E5%88%86%E7%B1%BB'%5D/li/a%22));%0A        %0A        for (WebElement colorCategory : colorCategoryList) %7B%0A        %09%0A        %09// simulate choosing a color%0A        %09colorCategory.click();%0A        %09%0A        %09WebElement selectedColorLi = webDriver.findElement(By.xpath(%22//*%5Bcontains(concat(' ', normalize-space(@class), ' '), ' tb-selected ')%5D%22));%0A        %09System.out.println(%22selectedLi: %22 + selectedColorLi.findElements(By.cssSelector(%22a %3E span%22)).get(0).getAttribute(%22innerHTML%22));%0A        %09
 %0A   
@@ -1438,32 +1438,33 @@
       %09%0A        
+%09
 System.out.print
@@ -1459,36 +1459,36 @@
 em.out.println(%22
-titl
+pric
 e: %22 + webDriver
@@ -1488,28 +1488,181 @@
 bDriver.
-getTitle());
+findElement(By.id(%22J_PromoPriceNum%22)).getText());%0A        %09System.out.println(%22stock: %22 + webDriver.findElement(By.id(%22J_SpanStock%22)).getText());%0A        %09%0A        %7D
 %0A       

test selenium