Package org.jsoup

Examples of org.jsoup.Connection.followRedirects()


    public void run(Channel channel, User from, String command, String[] args, String unparsed) {
        try {
            Connection con;

            con = Jsoup.connect(url.toString());
            con.followRedirects(true);
            con.execute();

            if (con.response().statusCode() == 200) {
                String[] response = BotAppletUtil.blockFormat(con.response().body(), 300, 10);
                channel.writeMultiple(response);
View Full Code Here


            url = new URLBuilder("http://en.wikipedia.org/w/index.php");
            url.setParameter("search", unparsed);

            while (true) {
                con = Jsoup.connect(url.toString());
                con.followRedirects(false);
                con.execute();

                if (con.response().statusCode() == 200) {
                    doc = con.response().parse();
                    break;
View Full Code Here

                url.setParameter("term", unparsed);
            }

            while (true) {
                con = Jsoup.connect(url.toString());
                con.followRedirects(false);
                con.execute();

                if (con.response().statusCode() == 200) {
                    doc = con.response().parse();
                    break;
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.