Package org.jsoup.nodes

Examples of org.jsoup.nodes.Document.text()


      Connection conn = null;
        String url = "http://www.hq6m.com/?act=login_check&user="+user+"&pwd="+pwd;
        conn = ConnectionManager.getInstance().getConnection(url);
//        conn.cookie("id", "21").data("id","21","page",""+pageNo,"rows","50");
        Document doc = conn.get();
        String res = doc.text();
        if ("用户名格式不正确,用户名不存在".indexOf(res)>-1) {
          System.out.println(user+":user error or not existed.");
        }else {
          existed = true;
          if ("登陆密码不正确".indexOf(res) == -1){
View Full Code Here


      Connection conn = null;
      String url = "http://www.hq6m.com/?act=login_check&user="+user+"&pwd="+pwd;
      conn = ConnectionManager.getInstance().getConnection(url);
//        conn.cookie("id", "21").data("id","21","page",""+pageNo,"rows","50");
      Document doc = conn.post();
      String res = doc.text();
      System.out.println(res);
      if ("用户名格式不正确,登陆密码不正确,错误[错误码: -5]".indexOf(res)>-1
          || "密码格式不正确".indexOf(res) > -1) {
       
      }else{
View Full Code Here

//            //System.out.println(imgUrl);
//            getLogoFromWeb(imgUrl, filePath);
//          }
//        }
        doc = ConnectionManager.getInstance().getDocument(url+(++pageNo));
      } while (doc.text().contains("下一页"));
      System.out.println("**********END**********");
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

      doc = ConnectionManager.getInstance().getDocument(url);
    } catch (Exception e) {
      logger.error("connect fail..", e);
      return null;
    }
    String resultStr = doc.text();
    Map<String,Object> infoMap = new HashMap<String, Object>();
    JSONObject object = JSONObject.fromObject("{\""+resultStr.substring(resultStr.indexOf("totalItem")));
    infoMap.put("totalItem", object.get("totalItem"));
    infoMap.put("lotteryType", object.get("lotteryType"));
    infoMap.put("totalPage", object.get("totalPage"));
View Full Code Here

      e.printStackTrace();
    }
    Map<String, String> resMap = null;
    if (doc!=null) {
      resMap = new HashMap<String, String>();
      JSONArray jsonArray = JSONArray.fromObject("[" + doc.text() + "]");
      JSONObject objRoot = null;
      for (int i = 0, l = jsonArray.size(); i < l; i++) {
        objRoot = jsonArray.getJSONObject(i);
        String reString = (String) objRoot.get("openResult");
        //String[] res = reString.split("</i>");
View Full Code Here

      doc = ConnectionManager.getInstance().getDocument(url);
    } catch (Exception e) {
      logger.error("connect fail..", e);
      return null;
    }
    String resultStr = doc.text();
    Map<String,Object> infoMap = new HashMap<String, Object>();
    JSONObject object = JSONObject.fromObject("{\""+resultStr.substring(resultStr.indexOf("totalItem")));
    infoMap.put("totalItem", object.get("totalItem"));
    infoMap.put("lotteryType", object.get("lotteryType"));
    infoMap.put("totalPage", object.get("totalPage"));
View Full Code Here

        Document doc=Jsoup.parse(page.getHtml());
        doc.setBaseUri(url);     
        page.setDoc(doc);
       
        String title=doc.title();
        String text=doc.text();
    
        ArrayList<Link> links = topNFilter(LinkUtils.getAll(page));
        ParseData parsedata = new ParseData(url,title, links);
        ParseText parsetext=new ParseText(url,text);
       
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.