|
@@ -0,0 +1,40 @@
|
|
|
+package org.springblade.manager.utils;
|
|
|
+
|
|
|
+import com.alibaba.excel.util.DateUtils;
|
|
|
+import org.jsoup.Connection;
|
|
|
+import org.jsoup.Jsoup;
|
|
|
+import org.jsoup.nodes.Document;
|
|
|
+import org.jsoup.nodes.Element;
|
|
|
+import org.jsoup.select.Elements;
|
|
|
+
|
|
|
+import java.io.IOException;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+public class test {
|
|
|
+
|
|
|
+ private static String URL = "http://www.tianqihoubao.com/lishi/";
|
|
|
+
|
|
|
+ public static void main111(String[] args) {
|
|
|
+ getWeather("重庆市");
|
|
|
+ }
|
|
|
+
|
|
|
+ public static Map<String,Object> getWeather(String city){
|
|
|
+
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
+ String pinYin = "chongqing";//Pinyin4jUtils.getPinYin(city);
|
|
|
+ pinYin = pinYin.replace("shi","");
|
|
|
+ String yyMMdd = "202303";//DateUtils.getFormat("yyyyMMdd");
|
|
|
+ Document document = null;
|
|
|
+ try {
|
|
|
+ document = Jsoup.connect("http://www.tianqihoubao.com/lishi/chongqing/month/202303.html").get();
|
|
|
+ Element body = document.body();
|
|
|
+ Elements table = body.getElementsByTag("table");
|
|
|
+ System.out.println("ddd");
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|