Package org.jsoup.select

Examples of org.jsoup.select.Elements.first()


                Elements donwloadLink = doc.select("div.alt1 b a[href^=//d.facdn.net/]");
                if (donwloadLink.size() == 0) {
                    logger.warn("Could not download " + this.url);
                    return;
              }
                String link = "http:" + donwloadLink.first().attr("href");
                logger.info("Found URL " + link);
                addURLToDownload(new URL(link),"","",url.toExternalForm(),cookies);
            } catch (IOException e) {
                logger.error("[!] Exception while loading/parsing " + this.url, e);
          }
View Full Code Here


        // Find next page
        Elements hrefs = doc.select("a.next");
        if (hrefs.size() == 0) {
            throw new IOException("No more pages");
        }
        String nextUrl = "http://www.bcfakes.com" + hrefs.first().attr("href");
        sleep(500);
        return Http.url(nextUrl).get();
    }
   
    @Override
View Full Code Here

                    String prefix = "";
                    if (Utils.getConfigBoolean("download.save_order", true)) {
                        prefix = String.format("%03d_", index);
                    }
                    synchronized (flickrThreadPool) {
                        addURLToDownload(new URL(fullsizeImages.first().attr("src")), prefix);
                    }
                }
            } catch (IOException e) {
                logger.error("[!] Exception while loading/parsing " + this.url, e);
            }
View Full Code Here

    public String getAlbumTitle(URL url) throws MalformedURLException {
        try {
            // Attempt to use album title as GID
            Document doc = getFirstPage();
            Elements elems = doc.select(".albumName");
            return getHost() + "_" + elems.first().text();
        } catch (Exception e) {
            // Fall back to default album naming convention
            logger.warn("Failed to get album title from " + url, e);
        }
        return super.getAlbumTitle(url);
View Full Code Here

        if (doc.select("li.next.hidden").size() > 0) {
            // Last page
            throw new IOException("No more pages");
        }
        Elements els = doc.select("li.next > a");
        Element first = els.first();
        String nextURL = first.attr("href");
        nextURL = "http://www.hentai-foundry.com" + nextURL;
        return Http.url(nextURL)
                   .referrer(url)
                   .cookies(cookies)
View Full Code Here

                Elements images = doc.select(".gbBlock img");
                if (images.size() == 0) {
                    logger.error("Failed to find image at " + this.url);
                    return;
                }
                String file = images.first().attr("src");
                if (file.startsWith("/")) {
                    file = "http://nfsfw.com" + file;
                }
                String prefix = "";
                if (Utils.getConfigBoolean("download.save_order", true)) {
View Full Code Here

        // Find next page
        Elements hrefs = doc.select("a.pagination_current + a.pagination_link");
        if (hrefs.size() == 0) {
            throw new IOException("No more pages");
        }
        String nextUrl = "http://www.imagebam.com" + hrefs.first().attr("href");
        sleep(500);
        return Http.url(nextUrl).get();
    }
   
    @Override
View Full Code Here

    @Override
    public String getAlbumTitle(URL url) throws MalformedURLException {
        try {
            // Attempt to use album title as GID
            Elements elems = getFirstPage().select("legend");
            String title = elems.first().text();
            logger.info("Title text: '" + title + "'");
            Pattern p = Pattern.compile("^(.*)\\s\\d* image.*$");
            Matcher m = p.matcher(title);
            if (m.matches()) {
                return getHost() + "_" + getGID(url) + " (" + m.group(1).trim() + ")";
View Full Code Here

                Elements images = doc.select("td > img");
                if (images.size() == 0) {
                    logger.warn("Image not found at " + this.url);
                    return;
                }
                Element image = images.first();
                String imgsrc = image.attr("src");
                logger.info("Found URL " + imgsrc);
                // Provide prefix and let the AbstractRipper "guess" the filename
                String prefix = "";
                if (Utils.getConfigBoolean("download.save_order", true)) {
View Full Code Here

                                   .referrer(this.url)
                                   .get();
               
                // Find image
                Elements images = doc.select("#photoImageSection img");
                Element image = images.first();
                String imgsrc = image.attr("src");
                logger.info("Found URL " + imgsrc + " via " + images.get(0));
               
                // Provide prefix and let the AbstractRipper "guess" the filename
                String prefix = "";
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.