• 查询数据,从链接地址中爬取文章内容jsoup


    查询数据,从链接地址中爬取文章内容

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            // TODO Auto-generated method stub
            //response.getWriter().append("Served at: ").append(request.getContextPath());
            int pageNum=1;
            int pageSize=100;
            for(pageNum=1;pageNum<101;pageNum++)
            {
                try {
                    int page1= (pageNum-1)*pageSize;
                    Map<Integer,String> map1 = ManageMySQL.getPageData(page1,pageSize);
                    for(Integer key : map1.keySet())
                    {
                        System.out.println(key+"  "+map1.get(key));
                        String context1 = getContentByURL(map1.get(key)).replace(" ", "");
                        ManageMySQL.updateContext(key, context1);
                    }
                } catch (Exception e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                
            }
            
            
            
        }
  • 相关阅读:
    mongostat
    mongodb的游标方法
    mongodb升级
    mongodb的白名单
    mongodb的副本集方法
    mongodb的collection方法
    mongodb的db方法
    mongoexport
    mongoimport
    mongodb分片集群管理
  • 原文地址:https://www.cnblogs.com/herd/p/11716503.html
Copyright © 2020-2023  润新知