Package org.jsoup

Examples of org.jsoup.Connection.post()


    }

    @Test
    public void followsRelativeRedirect() throws IOException {
        Connection con = Jsoup.connect("http://direct.infohound.net/tools/302-rel.pl"); // to ./ - /tools/
        Document doc = con.post();
        assertTrue(doc.title().contains("HTML Tidy Online"));
    }

    @Test
    public void throwsExceptionOnError() {
View Full Code Here


    }

    @Test
    public void followsRelativeRedirect() throws IOException {
        Connection con = Jsoup.connect("http://direct.infohound.net/tools/302-rel.pl"); // to ./ - /tools/
        Document doc = con.post();
        assertTrue(doc.title().contains("HTML Tidy Online"));
    }

    @Test
    public void followsRedirectsWithWithespaces() throws IOException {
View Full Code Here

//      conn.cookie("id", "21");
      conn.cookie("PcAicaip", "3307f%2FVmMBYVuaqdGe8QIi6otjFMA7yaPM%2Bh%2Fg3Gk1K2o4VadpS%2B3dFciwhDSxqYTnA%2F9KqvHrt0JECP3pc%2FxksZwewPkoJ27ZVdjXs2cxaWKmKLyLx5ljyn%2B%2Bitpg%2FqWq6yvHP%2FCypVgdU%2BBntiEGYC%2BYvrSrb83V7ceawUHWE");
      conn.cookie("PcAicain", "haha");
      conn.cookie("playTimes06481010C78141AB89F3EBBC43A1E9A9", "0");
      conn.cookie("5pao_VID_06481010C78141AB89F3EBBC43A1E9A9", "true");
      Document doc = conn.post();
      String res = doc.text();
      res = res.substring(res.indexOf("{"), res.indexOf("}")+1);
      JSONObject obj = JSONObject.fromObject(res);
      String title = obj.getString("title");
      String numbers = obj.getString("numbers");
View Full Code Here

//      conn.cookie("id", "21");
      conn.cookie("PcAicaip", "3307f%2FVmMBYVuaqdGe8QIi6otjFMA7yaPM%2Bh%2Fg3Gk1K2o4VadpS%2B3dFciwhDSxqYTnA%2F9KqvHrt0JECP3pc%2FxksZwewPkoJ27ZVdjXs2cxaWKmKLyLx5ljyn%2B%2Bitpg%2FqWq6yvHP%2FCypVgdU%2BBntiEGYC%2BYvrSrb83V7ceawUHWE");
      conn.cookie("PcAicain", "haha");
      conn.cookie("playTimes06481010C78141AB89F3EBBC43A1E9A9", "0");
      conn.cookie("5pao_VID_06481010C78141AB89F3EBBC43A1E9A9", "true");
      doc = conn.post();
      res = doc.text();
      res = res.substring(res.indexOf("{"), res.indexOf("}")+1);
      obj = JSONObject.fromObject(res);
      title = obj.getString("title");
      numbers = obj.getString("numbers");
View Full Code Here

 
  public void getIsPullData(String url,String id) {//100 BLSSC
    try {
      Connection conn = ConnectionManager.getInstance().getConnection(url);
      conn.cookie("id", id).data("id",id,"page","1","rows","10");
      Document doc = conn.post();
      String res = doc.text();
      JSONObject obj = JSONObject.fromObject(res);
      int total = obj.getInt("total");
      System.out.println("^^^^^^total:"+total +"  lastPullCount:"+lastPullCount+"~~~~~"+format.format(new Date()));
      isPullData = total != lastPullCount;
View Full Code Here

    int pageNo = 1;
    try {
      XmlUtils utils = new XmlUtils();
      Connection conn = ConnectionManager.getInstance().getConnection(url);
      conn.cookie("id", id).data("id",id,"page",""+pageNo,"rows","10");
      Document doc = conn.post();
      String res = doc.text();
      JSONObject obj = JSONObject.fromObject(res);
      int total = obj.getInt("total");
      int count = 0;
      boolean skipout = false;
View Full Code Here

      int count = 0;
      boolean skipout = false;
      do {
        conn = ConnectionManager.getInstance().getConnection(url);
        conn.cookie("id", id).data("id",id,"page",""+pageNo,"rows","50");
        doc = conn.post();
        res = doc.text();
        JSONArray rows = JSONObject.fromObject(res).getJSONArray("rows");
        count = count + rows.size();
        for (Object object : rows) {
          JSONObject row = (JSONObject) object;
View Full Code Here

      String today = new SimpleDateFormat("yyyyMMdd").format(new Date());
//      today = "20140917";
      XmlUtils utils = new XmlUtils();
      Connection conn = ConnectionManager.getInstance().getConnection(url);
      conn.cookie("id", id).data("id",id,"page",""+pageNo,"rows","10");
      Document doc = conn.post();
      String res = doc.text();
      JSONObject obj = JSONObject.fromObject(res);
      int total = obj.getInt("total");
      int count = 0;
      boolean skipout = false;
View Full Code Here

      int count = 0;
      boolean skipout = false;
      do {
        conn = ConnectionManager.getInstance().getConnection(url);
        conn.cookie("id", id).data("id",id,"page",""+pageNo,"rows","50");
        doc = conn.post();
        res = doc.text();
        JSONArray rows = JSONObject.fromObject(res).getJSONArray("rows");
        count = count + rows.size();
        for (Object object : rows) {
          JSONObject row = (JSONObject) object;
View Full Code Here

    try {
      String today = new SimpleDateFormat("yyyyMMdd").format(new Date());
      XmlUtils utils = new XmlUtils();
      Connection conn = ConnectionManager.getInstance().getConnection(url);
      conn.cookie("id", id).data("id",id,"page",""+pageNo,"rows","10");
      Document doc = conn.post();
      String res = doc.text();
      JSONObject obj = JSONObject.fromObject(res);
      int total = obj.getInt("total");
      int count = 0;
      boolean skipout = false;
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.