title: How to find a specific meta tag
body: <p>I am trying to retrieve a meta tag (Tag name=Generator) using Jsoup parser in java.</p>
  
  <p>The code I have is given below:</p>
  
  <pre><code>Elements metalinks=doc.select("meta"); // meta
  
  boolean metafound=false;
  for (Element singlemeta : metalinks) 
  {
      metatagname = singlemeta.attr("abs:name");
      metatagcontent = singlemeta.attr("abs:content");
      if((metatagname=="Generator")||(metatagname=="generator")||(metatagname=="GENERATOR")){
          //  this is the tag we want to get value of...
          metarequired=metatagcontent;
          metafound=true;
      }
  }   
  if(metafound==false)
      metarequired="NOT_FOUND";
  </code></pre>
  
  <p>However I am unable to extract the meta <code>GENERATOR</code> tag correctly.</p>
  
  <p>One example of this tag is now given below:</p>
  
  <pre><code>&lt;meta name="generator" content="Test page" /&gt;
  </code></pre>
  
  <p>For the very first line in code given above, I also tried the following code but that also does not work:</p>
  
  <pre><code>//Elements metalinks= doc.getElementsByTag("meta");
  </code></pre>
  
  <p>How do I extract the meta tag correctly?</p>