title: How to getElementById using DOM?
body: <p>I am having part of HTML page given below and want to extract the content of div tag its id is <code>hiddenDivHL</code> using DOM Parser:</p>
  <h3>Part Of a HTML Page:</h3>
  <pre><code>&lt;div id='hiddenDivHL' style='display:none'&gt;http://74.127.61.106/udayavaniIpad/details.php?home=0&amp;catid=882&amp;newsid=123069[InnerSep]http://www.udayavani.com/udayavani_cms/gall_content/2012/1/2012_1$thumbimg117_Jan_2012_000221787.jpg[InnerSep]ಯುವಜನತೆಯಿಂದ ಭವ್ಯಭಾರತ[OuterSep]
  </code></pre>
  <p>So far I have used the below code but I am unable to use <code>getElementById</code>.How to do that?</p>
  <h3>DOM Parser:</h3>
  <pre><code>    try {
  
          URL url = new URL(&quot;http://74.127.61.106/udayavaniIpad/details_android.php?home=1&amp;catid=882&amp;newsid=27593&quot;);
          DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
          DocumentBuilder db = dbf.newDocumentBuilder();
          Document doc = db.parse(new InputSource(url.openStream()));
          doc.getDocumentElement().normalize();
  
          NodeList nodeList = doc.getElementsByTagName(&quot;item&quot;);
  
          /** Assign textview array lenght by arraylist size */
          name = new TextView[nodeList.getLength()];
          website = new TextView[nodeList.getLength()];
          category = new TextView[nodeList.getLength()];
  
          for (int i = 0; i &lt; nodeList.getLength(); i++) {
  
              Node node = nodeList.item(i);
  
              name[i] = new TextView(this);
              
              Element fstElmnt = (Element) node;
              NodeList nameList = fstElmnt.getElementsByTagName(&quot;hiddenDivHL&quot;);
              Element nameElement = (Element) nameList.item(0);
              nameList = nameElement.getChildNodes();
              name[i].setText(&quot;Name = &quot;
                      + ((Node) nameList.item(0)).getNodeValue());
  
              
              layout.addView(name[i]);
              
              
  
          }
      } catch (Exception e) {
          System.out.println(&quot;XML Pasing Excpetion = &quot; + e);
      }
  
      /** Set the layout view to display */
      setContentView(layout);
  
  }
  </code></pre>