Query data link address from crawling content of the article jsoup

Query data link address from crawling content of the article

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 = (pageno-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();
            }
            
        }
        
        
        
    }

 

Guess you like

Origin www.cnblogs.com/herd/p/11716503.html