抓取起点网站内容
static String gethtml(String ul) {
String url = ul;
InputStream is = null;
InputStreamReader isr = null;
try {
URL u = new URL(url);
HttpURLConnection uc = (HttpURLConnection) u.openConnection();
//设置header
uc.setRequestMethod("GET");
uc.setRequestProperty("User-Agent",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3895.5 Safari/537.36");
uc.setRequestProperty("Accept-Language", "zh-CN,zh;q=0.9");
// uc.setRequestProperty("Accept-Encoding", "gzip, deflate");
uc.setRequestProperty("Accept",
"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3");
uc.setRequestProperty("Connection", "keep-alive");
uc.connect();
is = uc.getInputStream();
isr = ne