Commit 672054e6 by chenweitao

Merge branch 'working' into 'master'

更新快手采集程序

See merge request !171
parents 78ec2769 8fc1718a
...@@ -53,9 +53,9 @@ public class KuaiShouHotSearchCrawler { ...@@ -53,9 +53,9 @@ public class KuaiShouHotSearchCrawler {
List<HotSearchList> list= new ArrayList<>(); List<HotSearchList> list= new ArrayList<>();
JSONObject jsonObject = null; JSONObject jsonObject = null;
try { try {
String substring = htmlBody.substring(htmlBody.indexOf("homexxunknown")+15, htmlBody.indexOf("homexxfilmcomlist")+18); String substring = htmlBody.substring(htmlBody.indexOf("homexxunknown")+15, htmlBody.indexOf("homexxthealist")+18);
String sub = "{"+substring.substring(substring.indexOf("VisionHotRankResult") + 22, substring.indexOf("llsid") - 2)+"}}"; String sub = "{"+substring.substring(substring.indexOf("VisionHotRankResult") + 22, substring.indexOf("homexxthealist") - 2)+"}}";
String substring1 = sub.substring(0,sub.indexOf("$ROOT_QUERY.visionMovieRank") - 2)+"}"; String substring1 = sub.substring(0,sub.indexOf("VisionHotRankItem\"},\"$ROOT") + 19)+"}";
jsonObject = JSONObject.parseObject(substring1); jsonObject = JSONObject.parseObject(substring1);
//获取每个jsonObject对象的值 //获取每个jsonObject对象的值
Collection<Object> values = jsonObject.values(); Collection<Object> values = jsonObject.values();
...@@ -83,11 +83,11 @@ public class KuaiShouHotSearchCrawler { ...@@ -83,11 +83,11 @@ public class KuaiShouHotSearchCrawler {
} }
HotSearchList hotSearchList = new HotSearchList(url,name,hot,true,rank, HotSearchType.快手热榜.name(),tagType,date); HotSearchList hotSearchList = new HotSearchList(url,name,hot,true,rank, HotSearchType.快手热榜.name(),tagType,date);
list.add(hotSearchList); list.add(hotSearchList);
} catch (NumberFormatException e) { } catch (Exception e) {
log.error("解析快手热榜时出现解析错误",e); log.error("解析快手热榜时出现解析错误",e);
} }
} }
} catch (NumberFormatException e) { } catch (Exception e) {
log.error("解析快手热榜时出现解析错误,数据不是json结构",e); log.error("解析快手热榜时出现解析错误,数据不是json结构",e);
} }
return list; return list;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment