Java HTML Jsoup Document getTitleFromDocument(Document doc)

Here you can find the source of getTitleFromDocument(Document doc)

Description

get Title From Document

License

Open Source License

Declaration

public static String getTitleFromDocument(Document doc) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import org.jsoup.nodes.Document;

public class Main {
    public static String getTitleFromDocument(Document doc) {
        String title = (doc != null) ? doc.title() : "none";
        String[] titleText = title.split("-");
        return titleText[0].trim();
    }//from   w  ww  .j a v a  2s. c om
}

Related

  1. getInfoboxLines(final Document html, final boolean stripColor)
  2. getJSoupHtmlDocument(final String url)
  3. getJSoupXmlDocument(final String url)
  4. getLoginFields(Document doc)
  5. getTextFromAvailableDivID(Document doc, String divID)
  6. keepLineBreak(Document docRes)
  7. makeAbsolute(Document doc)
  8. normalizeWhitespaces(Document doc)
  9. postDocument(String url, Collection data)