腾讯搜索.js 876 B

123456789101112131415161718192021222324252627
  1. js:
  2. let d = [];
  3. pdfa=jsp.pdfa;pdfh=jsp.pdfh;pd=jsp.pd;
  4. let html = request(input);
  5. let baseList=pdfa(html,'body&&.result_item_v');
  6. baseList.forEach(function(it){
  7. let longText=pdfh(it,'.result_title&&Text');
  8. let shortText=pdfh(it,'.sub&&Text');
  9. let fromTag=pdfh(it,'.result_source&&Text');
  10. let score=pdfh(it,'.result_score&&Text');
  11. let content=pdfh(it,'.desc_text&&Text');
  12. let url=pdfh(it,'.result_title&&a&&href');
  13. // log(url);
  14. let img= pd(it,'.figure_pic&&src');
  15. url='https://node.video.qq.com/x/api/float_vinfo2?cid='+url.match(/.*\/(.*?)\.html/)[1];
  16. log(shortText+'|'+url);
  17. if (fromTag.match(/腾讯/)) {
  18. d.push({
  19. title: longText.split(shortText)[0],
  20. img: img,
  21. url: url,
  22. content:content,
  23. desc:"⭐"+longText.split(shortText)[1]+'-'+shortText+' '+score
  24. });
  25. }
  26. });
  27. setResult(d);