nikeodong

/** 天气URL/
public static final String TQ_URL="https://tianqiapi.com/api.php";
//TODO https://tianqiapi.com/api.php?style=tq //有更多内容
/** 抽取参数空格符
/
public static final String K_G="\u3000";

Calendar now = Calendar.getInstance();
String html = HttpClientUtil.getFromUrl(TQ_URL,null);
Document doc = Jsoup.parse(html);
Elements rows = doc.select("em");
String rtn = rows.get(0).text()+K_G+rows.get(1).text()+K_G+rows.get(2).text();
String paramValue = "今天是:"+now.get(Calendar.YEAR)+"年"+(now.get(Calendar.MONTH) + 1)+"月"+now.get(Calendar.DAY_OF_MONTH)+"日"+K_G+week+K_G+rtn;
(效果见附图)

分类:

技术点:

相关文章:

  • 2021-12-17
  • 2022-01-12
  • 2021-08-21
  • 2022-02-03
  • 2021-11-03
  • 2021-12-14
  • 2021-11-16
  • 2021-11-13
猜你喜欢
  • 2022-12-23
  • 2021-06-11
  • 2022-02-18
  • 2022-12-23
  • 2021-10-31
  • 2021-11-30
  • 2022-12-23
相关资源
相似解决方案