package com.yunyan.web;

import com.yunyan.common.utils.http.HttpUtils;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;

public class test77 {
    public static void main(String[] args) {
        String url = "http://www.baise.gov.cn/zwgk/jcxxgk/czyjs/bmjs/t13138364.shtml"; // 替换为要获取日期的网站URL
        System.out.println("value值："+getDate(url));
    }

    public static String getDate(String url) {
        String value = "";
        String html = HttpUtils.sendGet(url);
        Document doc = Jsoup.parse(html);
        Element span = doc.selectFirst("div.article-inf-left");
        if (span != null) {
            value = span.text();
            System.out.println("value值：" + value);
        } else {
            System.out.println("未找到对应的元素");
        }
        return value;
    }
}
