自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Jsuop進行鏈接提取

開發(fā) 開發(fā)工具
博主發(fā)表的文章,有的是自己原創(chuàng),有的是這些年本人從網(wǎng)上積累的,方便大家學習。

 [[178886]]

  1. // 檢索WebContent中的圖片和附件 
  2.  Document doc = Jsoup.parse(info.getWebc().getWebContent()); 
  3.  // 當前頁中的圖片 
  4.  Elements srcLinks = doc.select("img[src]"); 
  5.  String imagesPath = ""
  6.  for (Element link : srcLinks) { 
  7.  // 剔除標簽,只剩鏈接路徑 
  8.  String imagesPaths = link.attr("src"); 
  9.  String ht = imagesPaths.substring(0, 4); 
  10.  String htt = imagesPaths.substring(0, 1); 
  11.  if (!ht.equals("http") && htt.equals("/")) { 
  12.  imagesPath = imagesPaths.trim().replaceAll(ContextPath, ""); 
  13.  imagesPath = imagesPath.substring(imagesPath.lastIndexOf("/") + 1); 
  14.  } else { 
  15.  imagesPath = ""
  16.  } 
  17.  //System.out.println("---導入WebContent中的圖片---" + imagesPath); 
  18.  if (!imagesPath.equals("")) { 
  19.  importCopy("/html/"+strSiteID+"/"+strColumnID+"/"+keyID+"/"+imagesPath, path, strInfoID,"/html/"+strSiteID+"/"+strColumnID+"/"+keyID+"/"); 
  20.  } 
  21.  } 
  22.  // 提取所有的href連接 
  23.  String filePaths = ""
  24.  Elements linehrefs = doc.select("a[href]"); 
  25.  for (Element link : linehrefs) { 
  26.  filePaths = link.attr("href").trim().replaceAll(ContextPath, ""); 
  27.  filePaths = filePaths.substring(filePaths.lastIndexOf("/") + 1); 
  28.  //System.out.println("---導入WebContent中的文件---" + filePaths); 
  29.  if (!filePaths.equals("")) { 
  30.  importCopy("/html/"+strSiteID+"/"+strColumnID+"/"+keyID+"/"+filePaths, path, strInfoID,"/html/"+strSiteID+"/"+strColumnID+"/"+keyID+"/"); 
  31.  } 
  32.  } 

 【本文是51CTO專欄作者張勇波的原創(chuàng)文章,轉載請通過51CTO獲取作者授權】

責任編輯:武曉燕 來源: 上下求索的Z先生博客
相關推薦

2023-10-20 16:14:43

2011-04-02 14:24:25

SQL Server數(shù)網(wǎng)絡鏈接

2020-07-08 15:43:26

數(shù)據(jù)機器學習提取

2023-11-30 08:36:10

選擇器鏈接設計

2025-01-16 16:24:07

2022-08-09 07:57:25

Linux操作系統(tǒng)Windows

2021-11-12 23:44:28

Windows 10Windows微軟

2017-01-15 15:27:51

Linux軟連接和硬鏈接

2022-02-28 09:44:09

Linux硬鏈接軟鏈接

2023-11-15 08:27:46

Linux系統(tǒng)

2017-02-24 11:31:17

Android顏色提取Palette

2018-11-09 10:10:09

Linux硬鏈接軟鏈接

2019-11-01 11:06:02

Linux操作系統(tǒng)Windows

2018-11-09 10:30:05

Linux硬鏈接軟鏈接

2020-06-01 19:00:42

Linux軟鏈接硬鏈接

2009-09-15 14:30:11

Linq連接

2020-07-13 07:30:12

Linux提取文件腳本

2010-05-04 13:09:21

Unix操作系統(tǒng)

2023-03-05 16:36:14

Linux鏈接目標文件

2022-10-21 08:18:54

Linuxln 命令
點贊
收藏

51CTO技術棧公眾號