|
|
@ -7,10 +7,8 @@ import com.zdxt.auth.dto.DictDataBean; |
|
|
import com.zdxt.code.service.impl.MssqApiServiceImpl; |
|
|
import com.zdxt.code.service.impl.MssqApiServiceImpl; |
|
|
import com.zdxt.common.util.StringUtils; |
|
|
import com.zdxt.common.util.StringUtils; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.apache.http.Header; |
|
|
import org.apache.http.*; |
|
|
import org.apache.http.HttpConnection; |
|
|
import org.apache.http.client.HttpClient; |
|
|
import org.apache.http.HttpEntity; |
|
|
|
|
|
import org.apache.http.NameValuePair; |
|
|
|
|
|
import org.apache.http.client.config.RequestConfig; |
|
|
import org.apache.http.client.config.RequestConfig; |
|
|
import org.apache.http.client.entity.UrlEncodedFormEntity; |
|
|
import org.apache.http.client.entity.UrlEncodedFormEntity; |
|
|
import org.apache.http.client.methods.CloseableHttpResponse; |
|
|
import org.apache.http.client.methods.CloseableHttpResponse; |
|
|
@ -29,6 +27,8 @@ import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; |
|
|
import org.apache.http.message.BasicHeader; |
|
|
import org.apache.http.message.BasicHeader; |
|
|
import org.apache.http.message.BasicNameValuePair; |
|
|
import org.apache.http.message.BasicNameValuePair; |
|
|
import org.apache.http.util.EntityUtils; |
|
|
import org.apache.http.util.EntityUtils; |
|
|
|
|
|
import org.jsoup.Jsoup; |
|
|
|
|
|
import org.jsoup.nodes.Document; |
|
|
import org.slf4j.Logger; |
|
|
import org.slf4j.Logger; |
|
|
import org.slf4j.LoggerFactory; |
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
|
|
|
|
@ -237,5 +237,25 @@ public class HttpUtil { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
|
|
try { |
|
|
|
|
|
// String s = HttpSendGet("https://qr.szcredit.org.cn/GJQYCredit/GSZJGSPT/QYGS_Jump.aspx?rid=836E3C11540954A7A32077D8E724981E995A0B0521B91F8ECB1984EF3C175A05189FF39173BB0049", "");
|
|
|
|
|
|
// System.out.println(s);
|
|
|
|
|
|
// 选择 id 为 "main" 的元素
|
|
|
|
|
|
HttpClient httpClient = HttpClients.createDefault(); |
|
|
|
|
|
HttpGet pmethod = new HttpGet("https://qr.szcredit.org.cn/GJQYCredit/GSZJGSPT/QYGS_Jump.aspx?rid=836E3C11540954A7A32077D8E724981E995A0B0521B91F8ECB1984EF3C175A05189FF39173BB0049"); |
|
|
|
|
|
pmethod.addHeader("Connection", "keep-alive"); |
|
|
|
|
|
pmethod.addHeader("Cache-Control", "max-age=0"); |
|
|
|
|
|
pmethod.addHeader("User-Agent", "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0) "); |
|
|
|
|
|
pmethod.addHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/;q=0.8"); |
|
|
|
|
|
HttpResponse response = httpClient.execute(pmethod); |
|
|
|
|
|
String s = EntityUtils.toString(response.getEntity(), "utf-8"); |
|
|
|
|
|
Document doc = Jsoup.parse(s); |
|
|
|
|
|
String mainContent = doc.select("#lblEntSCCode").text(); |
|
|
|
|
|
System.out.println(mainContent); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
e.printStackTrace(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|