Package org.jsoup.Connection

Examples of org.jsoup.Connection.Response.cookies()


        postData.put(".save",   "");
        postData.put("login",   new String(Base64.decode("bGVmYWtlZGVmYWtl")));
        postData.put("passwd"new String(Base64.decode("MUZha2V5ZmFrZQ==")));
        String action = doc.select("form[method=post]").get(0).attr("action");
        resp = Jsoup.connect(action)
                    .cookies(resp.cookies())
                    .data(postData)
                    .method(Method.POST)
                    .execute();
        return resp.cookies();
    }
View Full Code Here


        resp = Jsoup.connect(action)
                    .cookies(resp.cookies())
                    .data(postData)
                    .method(Method.POST)
                    .execute();
        return resp.cookies();
    }

    /**
     * Helper class to find and download images found on "image" pages
     */
 
View Full Code Here

    }

    @Override
    public Document getFirstPage() throws IOException {
        Response resp = Http.url("http://www.hentai-foundry.com/").response();
        cookies = resp.cookies();
        resp = Http.url("http://www.hentai-foundry.com/?enterAgree=1&size=1500")
                   .referrer("http://www.hentai-foundry.com/")
                   .cookies(cookies)
                   .response();
        cookies.putAll(resp.cookies());
View Full Code Here

        cookies = resp.cookies();
        resp = Http.url("http://www.hentai-foundry.com/?enterAgree=1&size=1500")
                   .referrer("http://www.hentai-foundry.com/")
                   .cookies(cookies)
                   .response();
        cookies.putAll(resp.cookies());
        sleep(500);
        resp = Http.url(url)
                   .referrer("http://www.hentai-foundry.com/")
                   .cookies(cookies)
                   .response();
View Full Code Here

        sleep(500);
        resp = Http.url(url)
                   .referrer("http://www.hentai-foundry.com/")
                   .cookies(cookies)
                   .response();
        cookies.putAll(resp.cookies());
        return resp.parse();
    }
   
    @Override
    public Document getNextPage(Document doc) throws IOException {
View Full Code Here

   
    @Override
    public Document getFirstPage() throws IOException {
        if (albumDoc == null) {
            Response resp = Http.url(url).response();
            cookies.putAll(resp.cookies());
            albumDoc = resp.parse();
        }
        return albumDoc;
    }
   
View Full Code Here

            // Fetch the image page
            Response resp = Http.url(page)
                                .referrer(this.url)
                                .cookies(cookies)
                                .response();
            cookies.putAll(resp.cookies());

            // Try to find the "Download" box
            Elements els = resp.parse().select("a.dev-page-download");
            if (els.size() == 0) {
                throw new IOException("No download page found");
View Full Code Here

        // Send login request
        resp = Http.url("https://www.deviantart.com/users/login")
                    .userAgent(USER_AGENT)
                    .data(postData)
                    .cookies(resp.cookies())
                    .method(Method.POST)
                    .response();

        // Assert we are logged in
        if (resp.hasHeader("Location") && resp.header("Location").contains("password")) {
View Full Code Here

        if (resp.cookie("auth_secure") == null ||
            resp.cookie("auth") == null) {
            throw new IOException("No auth_secure or auth cookies received");
        }
        // We are logged in, save the cookies
        return resp.cookies();
    }
}
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.