xuzuoyun 4 anos atrás
pai
commit
7538c3c3cf

+ 17 - 1
module-crawler/src/main/java/cn/com/ctop/crawler/modules/taobao/service/impl/TaobaoJhsbybtServiceImpl.java

@@ -51,17 +51,20 @@ public class TaobaoJhsbybtServiceImpl implements TaobaoJhsbybtService {
         String sign = DigestUtils.md5Hex(token + "&" + paramMap.get("t") + "&" + paramMap.get("appKey") + "&" + paramMap.get("data"));
         paramMap.put("sign", sign);
         headerMap.put("Cookie", cookie);
+//        System.out.println(cookie);
         result = HttpUtils.httpGet(url, paramMap, headerMap);
         return result;
     }
 
     public static void main(String[] args) {
         try {
-            PrintStream out = new PrintStream("D:/bybt0901.csv");
+            PrintStream out = new PrintStream("D:/bybt0904.csv");
             System.setOut(out);
         } catch (FileNotFoundException e) {
             e.printStackTrace();
         }
+        System.out.println("商品id,商品名,销量,商品logo,设计图,商品图,商品链接,正常价,,,补贴价,补贴券");
+
         TaobaoJhsbybtServiceImpl tb = new TaobaoJhsbybtServiceImpl();
         int i = 1;
         Boolean hasMore = true;
@@ -72,6 +75,8 @@ public class TaobaoJhsbybtServiceImpl implements TaobaoJhsbybtService {
                 result = result.substring(0, result.length() - 1);
                 ObjectMapper mapper = new ObjectMapper();
                 JsonNode rootNode = mapper.readTree(result);
+//                System.out.println(HttpUtils.COOKIESTORE.toString());
+//                System.out.println(result);
                 Boolean success = rootNode.get("data").get("resultValue").get("8613423").get("success").asBoolean();
                 while (!success) {
                     Thread.sleep(3000L);
@@ -98,6 +103,17 @@ public class TaobaoJhsbybtServiceImpl implements TaobaoJhsbybtService {
                     String cutPrice = itemNode.get("cutPrice").asText();
                     String itemUrl = itemNode.get("itemUrl").asText();
                     String itemId = itemNode.get("itemId").asText();
+                    System.out.println(itemId+","+cjmsItemName+","+
+                            itemSoldInfo+","+
+                            brandLogo+","+
+                            picUrl+","+
+                            cjmsTaobaoEntrance+","+
+                            itemUrl+","+
+                            actPrice+","+
+                            cutPrice+","+
+                            orgPrice+","+
+                            couponPrice+","+
+                            couponAmount);
                 }
                 i++;
                 Thread.sleep(3000L);