title: How do I display just the html tag in JSoup java?
body: <p>I am working on a school project, and am trying to parse an html webpage to just display the tag, like the output below without the closing tag. (I hand coded it)</p>
  
  <pre><code>&lt;html&gt;
   &lt;head&gt; 
    &lt;title&gt;
    &lt;basefont&gt; 
   &lt;body&gt; 
    &lt;h1&gt;
    &lt;h2&gt;
  </code></pre>
  
  <p>Here is my code so far only in my main method. </p>
  
  <pre><code>public class ReadWithScanner {
  public static void main(String[] args) throws IOException 
  {
      String URL ="http://csb.stanford.edu/class/public/pages/sykes_webdesign/05_simple.html";
      Document doc = Jsoup.connect(URL).get();        
      //Element p = doc.select("p");
      //Elements p = doc.getElementsByTag("h6");
      Elements p = doc.select("html");
      //System.out.println(p);
  
       DoublyLinkedList theList = new DoublyLinkedList();
  
        theList.insert(p);      // insert at front
  
        theList.displayTree();
  }
  </code></pre>
  
  <p>}</p>
  
  <p>and here is a few lines of my output so far.</p>
  
  <p><img src="https://i.stack.imgur.com/pfaTf.png" alt="enter image description here"></p>