Examples of absUrl()


Examples of org.jsoup.nodes.Element.absUrl()

      final String poster = post.select(author).first().text().trim();
     
      Element postLink = post.select("a[href~="+ postNumberPattern.pattern() + "]:not("+post_content+" a)").last();
      postLink.setBaseUri(thread);
      String postURL = postLink.absUrl("href");

      final Element postContent = post.select(post_content).first();
      final Elements allBoldTagsInThisPost = postContent.select(bold_commands);

      // First poster is automatically granted GM permissions
View Full Code Here

Examples of org.jsoup.nodes.Element.absUrl()

        // finished parsing the cache; load the thread to check for new posts
        readingFromCache = false;
        view.setProgress(2);
        Element linkToLastPost = allThePostsOnThisPage.last().select("a[href~="+ postNumberPattern.pattern() + "]:not("+post_content+" a)").last();
        linkToLastPost.setBaseUri(thread);
        parse(linkToLastPost.absUrl("href"));
      } else {
        // parse the next page
        // Get the button that opens the next page.
        Element nextButton = thisThreadPage.select(next_button).last();
        if (nextButton != null)
View Full Code Here

Examples of org.jsoup.nodes.Element.absUrl()

      } else {
        // parse the next page
        // Get the button that opens the next page.
        Element nextButton = thisThreadPage.select(next_button).last();
        if (nextButton != null)
          parse(nextButton.absUrl("href"));
      }
    }
    // otherwise do nothing
  }
View Full Code Here

Examples of org.jsoup.nodes.Element.absUrl()

        // column
        // sorting
        for (Element element : elements) {
          // if text is same and abs URLs points to same place, we got it
          if (templateParentLink.text().equals(element.text())
              && templateParentLink.absUrl("href").equals(element.absUrl("href"))) {
            return new RemoteDetectionResult(RemoteDetectionOutcome.RECOGNIZED_SHOULD_BE_SCRAPED,
                getTargetedServer(), "Remote is a generated index page of " + getTargetedServer());
          }
        }
      }
View Full Code Here

Examples of org.jsoup.nodes.Element.absUrl()

      parseAnnotatableText (data, child);
    }

    // <base href>: update the base uri
    if (child.tagName().equals("base")) {
      String href = child.absUrl("href");
      if (!Strings.empty(href)) { // ignore <base target> etc
        baseUri = href;
        // TODO - consider updating baseUri for relevant elements in the stack, eg rebase(stack, uri)
        // doc.get().setBaseUri(href); // set on the doc so doc.createElement(Tag) will get updated base
      }
View Full Code Here

Examples of org.jsoup.nodes.Element.absUrl()

        // test from attribute match
        submit = doc.select("input[value=百度一下]").first();
        assertEquals("su", submit.id());
        Element newsLink = doc.select("a:contains(新)").first();
        assertEquals("http://news.baidu.com", newsLink.absUrl("href"));

        // check auto-detect from meta
        assertEquals("GB2312", doc.outputSettings().charset().displayName());
        assertEquals("<title>百度一下,你就知道      </title>", doc.select("title").outerHtml());
View Full Code Here

Examples of org.jsoup.nodes.Element.absUrl()

        // test from attribute match
        submit = doc.select("input[value=百度一下]").first();
        assertEquals("su", submit.id());
        Element newsLink = doc.select("a:contains(新)").first();
        assertEquals("http://news.baidu.com", newsLink.absUrl("href"));

        // check auto-detect from meta
        assertEquals("GB2312", doc.outputSettings().charset().displayName());
        assertEquals("<title>百度一下,你就知道      </title>", doc.select("title").outerHtml());
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.