Jsoup主页:http://jsoup.org/

在Blog.java 加入

    private List<String> imageList=new LinkedList<String>(); // 博客里存在的图片,主要用于列表展示的缩略图

    for(Blog blog:blogList){
            List<String> imageList=blog.getImageList();
            String blogInfo=blog.getContent();
            Document doc=Jsoup.parse(blogInfo);
            Elements jpgs=doc.select("img[src$=.jpg]");
            for(int i=0;i<jpgs.size();i++){
                Element jpg=jpgs.get(i);
                imageList.add(jpg.toString());
                if(i==2){
                    break;
                }
            }
        }
View Code

相关文章:

  • 2022-12-23
  • 2021-10-05
  • 2021-09-14
  • 2022-12-23
  • 2021-05-07
  • 2021-09-05
  • 2021-06-24
猜你喜欢
  • 2021-08-14
  • 2022-12-23
  • 2021-05-27
  • 2022-02-04
  • 2022-12-23
  • 2022-03-06
相关资源
相似解决方案