title: Extract table from html file using python
body: <p>I want to extract table from an html file. I have written the following code-snippet to extract the first table: </p>
  
  <pre><code>import urllib2
  import os
  import time
  import traceback
  from bs4 import BeautifulSoup
  
  #find('table',{'class':'tbl_with_brdr'})
  outfile= open('D:/Dropbox/Python/apelec.txt','wb')
  rfile  = open('D:/Dropbox/PRI/Data/AP/195778.html')
  rsoup  = BeautifulSoup(rfile)
  nodes  = rsoup.find('div',{'class':'frmtext'}).find('table').find('tr')
  for node in nodes[1:]:
      x = node.find('th').find('b').get_text().encode("utf-8")
      print x 
      y   = node.find('th').findNext('th').find('b').get_text().encode("utf-8")
      print y
      outfile.write(str(x)+"\t"+str(y)+"\n")
  outfile.close()
  </code></pre>
  
  <p>Here is the error:</p>
  
  <pre><code>     9 rfile  = open('D:/Dropbox/PRI/Data/AP/195778.html')
       10 rsoup  = BeautifulSoup(rfile)
  ---&gt; 11 nodes  = rsoup.find('div',{'class':'frmtext'}).find('table').find('tr')
       12 for node in nodes[1:]:
       13     x = node.find('th').find('b').get_text().encode("utf-8")
       AttributeError: 'NoneType' object has no attribute 'find'
  </code></pre>
  
  <p>And the html file is:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;link rel="icon" type="image/ico" href="images/favicon.ico"/&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
  &lt;link rel="stylesheet" href="themes/panchayat_default.css" type="text/css"/&gt;
  &lt;title&gt;consolidated Election Report&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;!-- To blur the background while processing dwr --&gt;
  &lt;div class="faded_div process"&gt;&lt;/div&gt;
  &lt;div  class="popup_block_div process"  style="display: none;"&gt;
          &lt;img alt="" src="images/loading_animation.gif" style="margin-left: auto; margin-right: auto;"&gt;                              
  &lt;/div&gt;
  
  &lt;div id="maincontainer" class="resize"&gt;
  &lt;div id="headerwrap"&gt;   
      &lt;!-- Header --&gt;
  
  &lt;html&gt;
  &lt;head&gt;
   &lt;script type='text/javascript' src="/profilerdwr/engine.js"&gt; &lt;/script&gt;
   &lt;script type='text/javascript' src="/profilerdwr/util.js"&gt; &lt;/script&gt;
   &lt;script type="text/javascript" src="/profilerdwr/interface/lgdDao.js"&gt;&lt;/script&gt;
   &lt;script type="text/javascript" src="js/common_util_js.js"&gt;&lt;/script&gt;
   &lt;link rel="stylesheet" href="css/common_css.css" type="text/css"&gt;&lt;/link&gt;
   &lt;meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /&gt;
  &lt;/head&gt;
  &lt;body &gt;
  &lt;div class="clear"&gt;&lt;/div&gt;
  &lt;div id="headerwrap"&gt;       
   &lt;div id="header"&gt;
   &lt;div id="new_header"&gt;
                  &lt;div id="logoleft"&gt;Area Profiler&lt;/div&gt;
          &lt;div id="logoright"&gt;&lt;/div&gt;  
          &lt;div class="clear"&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="clear"&gt;&lt;/div&gt;
      &lt;div id="loginnav" align="right"&gt;
        &lt;table width="100%" class="tbl_no_brdr"&gt;
           &lt;tr&gt;
              &lt;td class="tblclear" align="left"&gt;
                &lt;div id="mainnav"&gt;&lt;a href="welcome.do?OWASP_CSRFTOKEN=CN72-BGJW-G7FM-K1S3-P5FF-V1EN-IO4T-GHWU"&gt;Home&lt;/a&gt; &lt;/div&gt;
              &lt;/td&gt;
  
              &lt;/tr&gt;
            &lt;/table&gt;
          &lt;/div&gt;
        &lt;/div&gt;
          &lt;div class="clear"&gt;&lt;/div&gt;
          &lt;div id="topnav"&gt;
            &lt;table width="100%" class="tbl_no_brdr"&gt;
              &lt;tr&gt;
                &lt;td width="85" class="tblclear"&gt;Choose Theme :&lt;/td&gt;
                &lt;td width="200" class="tblclear"&gt;
                  &lt;form id="themeForm" name="themeForm" method="get" action="welcome.do"&gt;
                      &lt;input type="hidden" name='OWASP_CSRFTOKEN' value='CN72-BGJW-G7FM-K1S3-P5FF-V1EN-IO4T-GHWU' /&gt;
                      &lt;select name="theme" id="themeId" class="combofield" onchange="submitThemeForm()" style="width: 120px;"&gt;
                              &lt;option value="default"&gt;Default Theme&lt;/option&gt;
                              &lt;option value="mustard"&gt;Mustard Theme&lt;/option&gt;
                              &lt;option value="peach"&gt;Peach Theme&lt;/option&gt;
                              &lt;option value="green"&gt;Green Theme&lt;/option&gt;
                              &lt;option value="blue"&gt;Blue Theme&lt;/option&gt;
                      &lt;/select&gt;
  
                &lt;/form&gt;
                &lt;/td&gt;
                &lt;td style="padding: 0px"&gt;
  
              &lt;/td&gt;
                &lt;td class="tblclear"&gt;&amp;nbsp;&lt;/td&gt;
                &lt;td width="14" class="tblclear txticon"&gt;&lt;a href="#" class="texttoggler " rel="smallview" title="small size"&gt;&lt;img src="images/btnMinus.jpg" width="16" height="14" border="0" /&gt;&lt;/div&gt;&lt;/a&gt;&lt;/td&gt;
                &lt;td width="14" class="tblclear txticon"&gt;&lt;a href="#" class="texttoggler" rel="normalview" title="normal size"&gt;&lt;img src="images/btnDefault.jpg" width="16" height="14" border="0" /&gt;&lt;/a&gt; &lt;/td&gt;
                &lt;td width="28" class="tblclear txticon"&gt;&lt;a href="#" class="texttoggler" rel="largeview" title="large size"&gt;&lt;img src="images/btnPlus.jpg" width="16" height="14" border="0" /&gt;&lt;/a&gt;&lt;/td&gt;
                &lt;script type="text/javascript" &gt;
                  //documenttextsizer.setup("shared_css_class_of_toggler_controls")
                  documenttextsizer.setup("texttoggler")            
                &lt;/script&gt;
                &lt;td width="100" align="right" class="tblclear"&gt;Select Language :&lt;/td&gt;
                &lt;td width="108" align="right" class="tblclear"&gt;
                  &lt;form id="languageForm" name="languageForm" method="get" action="welcome.do"&gt;
                  &lt;input type="hidden" name='OWASP_CSRFTOKEN' value='CN72-BGJW-G7FM-K1S3-P5FF-V1EN-IO4T-GHWU' /&gt;
                   &lt;select id="languageId" name="language" class="combofield" style="width: 120px;" onchange="submitLanguageForm()" &gt;
                          &lt;option value=""&gt; Select Language &lt;/option&gt;
  
                      &lt;/select&gt;
                &lt;/form&gt;
                &lt;/td&gt;
              &lt;/tr&gt;
            &lt;/table&gt;
        &lt;/div&gt;
        &lt;div id="breadcrumbnav"&gt;  &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
  
  function submitThemeForm()
  {
      var isOK = confirm("This will Refresh Your Page. Any Unsaved data will be Lost. Do You still want to Continue?");
      if(isOK)
      {
          document.getElementById('themeForm').submit();
      }
      else
      {
          return; 
      }
  }
  
  function submitLanguageForm()
  {
      var isOK = confirm("This will Refresh Your Page. Any Unsaved data will be Lost. Do You still want to Continue?");
      if(isOK)
      {
          document.getElementById('languageForm').submit();
      }
      else
      {
          return; 
      }
  }
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  
  &lt;/div&gt;
  
  &lt;div class="clear"&gt;&lt;/div&gt;
  &lt;div id="content"&gt;
      &lt;div id="leftpnl"&gt;
        &lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;
          &lt;tr&gt;
  
            &lt;td width="100%" valign="top" class="tblclear"&gt;
                  &lt;!--           content --&gt;.
               &lt;script type="text/javascript" src="js/common_js.js"&gt;&lt;/script&gt;
  
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
  
  
  &lt;script type="text/javascript"&gt;
  var pathname;
  $(document).ready(function() {pathname = window.location.pathname;});
  function onBack(s) {
      var position =pathname.indexOf("/", 2);
      var newPath = "";
      var val = s.indexOf("?", 1);
      if(val&gt;0)
          {
          newPath =  s+"&amp;redirect=true";
          }
      else
          {
          newPath =  s+"?redirect=true";
          }
      window.location.replace(".."+pathname.substring(0,position)+"/"+newPath);
  }
  
  function downloadReport(repformat){
      //window.location="downloadConsolidatedElectionReportPDF.do?OWASP_CSRFTOKEN=CN72-BGJW-G7FM-K1S3-P5FF-V1EN-IO4T-GHWU";
       //document.forms["electionReportForm"].action="downloadConsolidatedElectionReportPDF.do?repformat="+repformat+"&amp;OWASP_CSRFTOKEN=CN72-BGJW-G7FM-K1S3-P5FF-V1EN-IO4T-GHWU";
       document.forms["electionReportForm"].action="downloadConsolidatedElectionReportPDF.do?reportformat="+repformat+"&amp;OWASP_CSRFTOKEN=CN72-BGJW-G7FM-K1S3-P5FF-V1EN-IO4T-GHWU";
       document.forms["electionReportForm"].method="POST";
       document.getElementById('electionReportForm').target="_blank";
       document.forms["electionReportForm"].submit();
  }
  
  &lt;/script&gt;
  
  &lt;style type="text/css"&gt;
  .data_link{
      color:blue;
      display: block;
      text-decoration: none;
      font-size: 1em;
      font-weight: bolder;
  
  }
  .disable_link
  {
      cursor:default;
      color:blue;
      display: block;
      text-decoration: none;
      font-size: 1em;
      font-weight: bolder;
  
  }
  
  .data_link:VISITED
  {
      color:blue;
      display: block;
      text-decoration: none;
      font-size: 1em;
      font-weight: bolder;
  }
  
  .data_link:HOVER{
      text-decoration: underline;
  }
  &lt;/style&gt;
  
  
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div id="frmcontent"&gt;
              &lt;div class="frmhd"&gt;
                  &lt;table width="100%" class="tbl_no_brdr"&gt;
                  &lt;tr&gt;
                     &lt;td align="left" width="90%"&gt;
                         Consolidated Election&lt;/td&gt;
                         &lt;/tr&gt;
                        &lt;/table&gt;
              &lt;/div&gt;  
  &lt;div class="clear"&gt;&lt;/div&gt;   
  &lt;div class="frmpnlbrdr"&gt;                
  &lt;div class="frmpnlbg"&gt;
  &lt;div class="frmtxt"&gt;
  
                  &lt;table width="100%" style="margin-bottom: 10px;" class="tbl_with_brdr"&gt;
                          &lt;tr class="tblRowTitle tblclear" &gt;
                              &lt;th align="left" &gt;&lt;b&gt;State Name&lt;/b&gt;&lt;/th&gt;    
                              &lt;th align="left" &gt;&lt;b&gt;Local Body Type&lt;/b&gt;&lt;/th&gt;   
                              &lt;th align="left" &gt;&lt;b&gt;Election Term&lt;/b&gt;&lt;/th&gt; 
  
                                  &lt;th align="left" &gt;&lt;b&gt;Local Body Name&lt;/b&gt;&lt;/th&gt;   
  
                          &lt;/tr&gt;
                          &lt;tr class="tblRowB" style="color: blue;"&gt;
                              &lt;th  align="left"  &gt;ANDHRA PRADESH&lt;/th&gt; 
                              &lt;th  align="left" &gt;Village Panchayat&lt;/th&gt;   
                              &lt;th align="left"  &gt;
  
                                          02-Aug-2013 &amp;nbsp;&amp;nbsp;To&amp;nbsp;&amp;nbsp;
  
                                           01-Aug-2018
                              &lt;/th&gt;   
  
                                  &lt;th align="left" &gt;KODIHALLI&lt;/th&gt;    
  
                          &lt;/tr&gt;
                      &lt;/table&gt;
  
  &lt;div class="frmhdtitle"&gt;Consolidated Election&lt;/div&gt;
  &lt;table width="100%" class="tbl_with_brdr"&gt;
      &lt;thead&gt;
          &lt;tr class="tblRowTitle tblclear"&gt;
                          &lt;th align="center" width="5%" &gt;&lt;b&gt;S.No.&lt;/b&gt;&lt;/th&gt;
                          &lt;th align="left"   width="9%"&gt;&lt;b&gt;Name&lt;/b&gt;&lt;/th&gt;        0
                          &lt;th align="left" width="9%"&gt;&lt;b&gt;Age&lt;/b&gt;&lt;/th&gt;           1
                          &lt;th align="left" width="9%"&gt;&lt;b&gt;Caste Category&lt;/b&gt;&lt;/th&gt;  2
                          &lt;th align="left" width="9%"&gt;&lt;b&gt;Gender&lt;/b&gt;&lt;/th&gt;         3
                          &lt;th align="left" width="9%"&gt;&lt;b&gt;Qualification&lt;/b&gt;&lt;/th&gt;  4
                          &lt;th align="left" width="9%"&gt;&lt;b&gt;Occupation&lt;/b&gt;&lt;/th&gt;     5
                          &lt;th align="left" width="9%"&gt;&lt;b&gt;Email Address&lt;/b&gt;&lt;/th&gt;   6
                          &lt;th align="left" width="9%"&gt;&lt;b&gt;Ward Name&lt;/b&gt;&lt;/th&gt;       7
                          &lt;th align="left" width="9%"&gt;&lt;b&gt;Reservation&lt;/b&gt;&lt;/th&gt;    8
          &lt;/tr&gt;
      &lt;/thead&gt;
  
      &lt;tbody&gt;
  
                              &lt;tr class="tblRowB"&gt; 
  
                  &lt;td  align="center" &gt;1&lt;/td&gt;
                  &lt;td&gt;Kambanna&lt;/td&gt;
                  &lt;td&gt;36&lt;/td&gt;
                  &lt;td&gt;OBC&lt;/td&gt;
                  &lt;td&gt;Male&lt;/td&gt;
                  &lt;td&gt;Middle or Lower Secondary&lt;/td&gt;
                  &lt;td&gt;N/A&lt;/td&gt;
                  &lt;td&gt;
  
  
                              N/A
  
                  &lt;/td&gt;
                  &lt;td&gt;N/A&lt;/td&gt;
                  &lt;td &gt;
  
                       Yes  (OBC / Others)
  
                  &lt;/td&gt;           
              &lt;/tr&gt;
  
                  &lt;tr class="tblRowA"&gt;
  
                  &lt;td  align="center" &gt;2&lt;/td&gt;
                  &lt;td&gt;Ramesh&lt;/td&gt;
                  &lt;td&gt;39&lt;/td&gt;
                  &lt;td&gt;OBC&lt;/td&gt;
                  &lt;td&gt;Male&lt;/td&gt;
                  &lt;td&gt;Middle or Lower Secondary&lt;/td&gt;
                  &lt;td&gt;Workers not reporting any occupations&lt;/td&gt;
                  &lt;td&gt;
  
                              N/A
  
                  &lt;/td&gt;
                  &lt;td&gt;Ward no 1&lt;/td&gt;
                  &lt;td &gt;
  
                                  Yes (OBC / Others)
  
                  &lt;/td&gt;           
              &lt;/tr&gt;
  
                              &lt;tr class="tblRowB"&gt; 
  
                  &lt;td  align="center" &gt;3&lt;/td&gt;
                  &lt;td&gt;S.Manjunath&lt;/td&gt;
                  &lt;td&gt;29&lt;/td&gt;
                  &lt;td&gt;OBC&lt;/td&gt;
                  &lt;td&gt;Male&lt;/td&gt;
                  &lt;td&gt;Higher Secondary or Intermediate or Pre University or Senior Secondary&lt;/td&gt;
                  &lt;td&gt;Workers not reporting any occupations&lt;/td&gt;
                  &lt;td&gt;
  
                              N/A
  
                  &lt;/td&gt;
                  &lt;td&gt;Ward no 2&lt;/td&gt;
                  &lt;td &gt;
  
                                  No (General / Others)
  
                  &lt;/td&gt;           
              &lt;/tr&gt;
  
                  &lt;tr class="tblRowA"&gt;
  
                  &lt;td  align="center" &gt;4&lt;/td&gt;
                  &lt;td&gt;Obuleshu&lt;/td&gt;
                  &lt;td&gt;48&lt;/td&gt;
                  &lt;td&gt;OBC&lt;/td&gt;
                  &lt;td&gt;Male&lt;/td&gt;
                  &lt;td&gt;Below Primary&lt;/td&gt;
                  &lt;td&gt;Workers not reporting any occupations&lt;/td&gt;
                  &lt;td&gt;
  
  
                              N/A
  
                  &lt;/td&gt;
                  &lt;td&gt;Ward no 3&lt;/td&gt;
                  &lt;td &gt;
  
                                  No (General / Others)
  
                  &lt;/td&gt;           
              &lt;/tr&gt;
  
                              &lt;tr class="tblRowB"&gt; 
  
                  &lt;td  align="center" &gt;5&lt;/td&gt;
                  &lt;td&gt;Mamatha&lt;/td&gt;
                  &lt;td&gt;24&lt;/td&gt;
                  &lt;td&gt;OBC&lt;/td&gt;
                  &lt;td&gt;Female&lt;/td&gt;
                  &lt;td&gt;Matriculation or Junior School Certificate or Secondary&lt;/td&gt;
                  &lt;td&gt;N/A&lt;/td&gt;
                  &lt;td&gt;
  
                              N/A
  
                  &lt;/td&gt;
                  &lt;td&gt;Ward no 4&lt;/td&gt;
                  &lt;td &gt;
  
                                  Yes (General / Female)
  
                  &lt;/td&gt;           
              &lt;/tr&gt;
  
                  &lt;tr class="tblRowA"&gt;
  
                  &lt;td  align="center" &gt;6&lt;/td&gt;
                  &lt;td&gt;Shivamma&lt;/td&gt;
                  &lt;td&gt;38&lt;/td&gt;
                  &lt;td&gt;OBC&lt;/td&gt;
                  &lt;td&gt;Female&lt;/td&gt;
                  &lt;td&gt;Below Primary&lt;/td&gt;
                  &lt;td&gt;N/A&lt;/td&gt;
                  &lt;td&gt;
  
  
                              N/A
  
                  &lt;/td&gt;
                  &lt;td&gt;Ward no 5&lt;/td&gt;
                  &lt;td &gt;
  
                                  Yes (General / Female)
  
                  &lt;/td&gt;           
              &lt;/tr&gt;
  
                              &lt;tr class="tblRowB"&gt; 
  
                  &lt;td  align="center" &gt;7&lt;/td&gt;
                  &lt;td&gt;Hanumantappa&lt;/td&gt;
                  &lt;td&gt;46&lt;/td&gt;
                  &lt;td&gt;SC&lt;/td&gt;
                  &lt;td&gt;Male&lt;/td&gt;
                  &lt;td&gt;Illiterate&lt;/td&gt;
                  &lt;td&gt;N/A&lt;/td&gt;
                  &lt;td&gt;
  
  
                              N/A
  
                  &lt;/td&gt;
                  &lt;td&gt;Ward no 6&lt;/td&gt;
                  &lt;td &gt;
  
                                  No (General / Others)
  
                  &lt;/td&gt;           
              &lt;/tr&gt;
  
                  &lt;tr class="tblRowA"&gt;
  
                  &lt;td  align="center" &gt;8&lt;/td&gt;
                  &lt;td&gt;Malingappa&lt;/td&gt;
                  &lt;td&gt;45&lt;/td&gt;
                  &lt;td&gt;SC&lt;/td&gt;
                  &lt;td&gt;Male&lt;/td&gt;
                  &lt;td&gt;Illiterate&lt;/td&gt;
                  &lt;td&gt;N/A&lt;/td&gt;
                  &lt;td&gt;
  
  
                              N/A
  
                  &lt;/td&gt;
                  &lt;td&gt;Ward no 7&lt;/td&gt;
                  &lt;td &gt;
  
                                  No (General / Others)
  
                  &lt;/td&gt;           
              &lt;/tr&gt;
                              &lt;tr class="tblRowB"&gt; 
  
                  &lt;td  align="center" &gt;9&lt;/td&gt;
                  &lt;td&gt;Kamalamma&lt;/td&gt;
                  &lt;td&gt;52&lt;/td&gt;
                  &lt;td&gt;OBC&lt;/td&gt;
                  &lt;td&gt;Female&lt;/td&gt;
                  &lt;td&gt;Illiterate&lt;/td&gt;
                  &lt;td&gt;N/A&lt;/td&gt;
                  &lt;td&gt;
  
  
                              N/A
  
                  &lt;/td&gt;
                  &lt;td&gt;Ward no 8&lt;/td&gt;
                  &lt;td &gt;
  
                                  Yes (OBC / Female)
  
                  &lt;/td&gt;           
              &lt;/tr&gt;
  
  
                  &lt;tr class="tblRowA"&gt;
  
  
                  &lt;td  align="center" &gt;10&lt;/td&gt;
                  &lt;td&gt;Muddamma&lt;/td&gt;
                  &lt;td&gt;48&lt;/td&gt;
                  &lt;td&gt;OBC&lt;/td&gt;
                  &lt;td&gt;Female&lt;/td&gt;
                  &lt;td&gt;Illiterate&lt;/td&gt;
                  &lt;td&gt;N/A&lt;/td&gt;
                  &lt;td&gt;
  
  
                              N/A
  
                  &lt;/td&gt;
                  &lt;td&gt;Ward no 9&lt;/td&gt;
                  &lt;td &gt;
  
                                  Yes (General / Female)
  
                  &lt;/td&gt;           
              &lt;/tr&gt;
  
  
                              &lt;tr class="tblRowB"&gt; 
  
                  &lt;td  align="center" &gt;11&lt;/td&gt;
                  &lt;td&gt;Patta Tayamma&lt;/td&gt;
                  &lt;td&gt;45&lt;/td&gt;
                  &lt;td&gt;SC&lt;/td&gt;
                  &lt;td&gt;Female&lt;/td&gt;
                  &lt;td&gt;Middle or Lower Secondary&lt;/td&gt;
                  &lt;td&gt;N/A&lt;/td&gt;
                  &lt;td&gt;
  
  
                              N/A
  
                  &lt;/td&gt;
                  &lt;td&gt;Ward no 10&lt;/td&gt;
                  &lt;td &gt;
  
                                  Yes (SC / Female)
  
                  &lt;/td&gt;           
              &lt;/tr&gt;
  
  
                  &lt;tr class="tblRowA"&gt;
  
  
                  &lt;td  align="center" &gt;12&lt;/td&gt;
                  &lt;td&gt;Sujatha&lt;/td&gt;
                  &lt;td&gt;35&lt;/td&gt;
                  &lt;td&gt;OBC&lt;/td&gt;
                  &lt;td&gt;Female&lt;/td&gt;
                  &lt;td&gt;Middle or Lower Secondary&lt;/td&gt;
                  &lt;td&gt;N/A&lt;/td&gt;
                  &lt;td&gt;
  
  
                              N/A
  
                  &lt;/td&gt;
                  &lt;td&gt;Ward no 11&lt;/td&gt;
                  &lt;td &gt;
  
                                  Yes (OBC / Female)
  
                  &lt;/td&gt;           
              &lt;/tr&gt;
  
  
  
                              &lt;tr class="tblRowB"&gt; 
  
                  &lt;td  align="center" &gt;13&lt;/td&gt;
                  &lt;td&gt;Kadurappa&lt;/td&gt;
                  &lt;td&gt;35&lt;/td&gt;
                  &lt;td&gt;SC&lt;/td&gt;
                  &lt;td&gt;Male&lt;/td&gt;
                  &lt;td&gt;Middle or Lower Secondary&lt;/td&gt;
                  &lt;td&gt;N/A&lt;/td&gt;
                  &lt;td&gt;
  
  
                              N/A
  
                  &lt;/td&gt;
                  &lt;td&gt;Ward no 12&lt;/td&gt;
                  &lt;td &gt;
  
                                  Yes (SC / Others)
  
                  &lt;/td&gt;           
              &lt;/tr&gt;
  
      &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;br /&gt;
  
  &lt;table width="100%" class="tbl_no_brdr"&gt;
        &lt;tr&gt;
            &lt;td align="center"&gt;
                 &lt;input type="button" class="btn" onclick="onClose('welcome.do?OWASP_CSRFTOKEN=CN72-BGJW-G7FM-K1S3-P5FF-V1EN-IO4T-GHWU')"     value=Close /&gt;
  
  
                      &lt;input  type="button" class="btn" onclick="this.disabled=true; this.value='Please Wait .!';onBack('consolidatedElectionReport.do?OWASP_CSRFTOKEN=CN72-BGJW-G7FM-K1S3-P5FF-V1EN-IO4T-GHWU&amp;electionTermId=35107&amp;stateId=28')" value=Back /&gt;
  
            &lt;/td&gt;
        &lt;/tr&gt;
  &lt;/table&gt;  
  
  &lt;form id="electionReportForm" name="electionReportForm" action="#" method="post"&gt;
  &lt;div align="center"&gt;&lt;br/&gt;
      &lt;input type="button" class="btn" onclick="downloadReport('pdf');" value="Export to PDF" size="5" /&gt;
      &lt;input type="button" class="btn" onclick="downloadReport('xls');" value="Export to Excel" size="5" /&gt;
  &lt;/div&gt;
  &lt;/form&gt;               
  
  &lt;/div&gt;
          &lt;div class="myclass"
              style="font-family: Times; text-align: center; font-size: 10.0pt; color: white; font-weight: bold; border: 1px solid gray"&gt;
              Report generated through Area Profiler (http://areaprofiler.gov.in)Thu Oct 02 22:34:20 IST 2014
  
          &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  
            &lt;/td&gt;
          &lt;/tr&gt;
        &lt;/table&gt;
      &lt;/div&gt;
  &lt;/div&gt;  
  &lt;div class="clear"&gt;&lt;/div&gt;
  &lt;div id="footer"&gt; 
  &lt;!--    Footer --&gt;
  
  
  &lt;html&gt;
  &lt;head&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  
  
  &lt;table width="100%"  class="tbl_no_brdr"&gt;
           &lt;tr&gt;
            &lt;td colspan="3" class="fotbrdr"&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
  
            &lt;td width="161" class="btmlogospace"&gt;&lt;a href="http://www.negp.gov.in/" target= "_blank" &gt;&lt;img src="images/e_governance_logo.jpg" width="161" height="38" /&gt;&lt;/a&gt;&lt;/td&gt;
            &lt;td width="93" class="btmlogospace"&gt;&lt;a href="http://www.panchayat.gov.in/" target= "_blank" &gt;&lt;img src="images/panchayatilogo.jpg" width="93" height="38" /&gt;&lt;/a&gt;&lt;/td&gt;
  
            &lt;td align="right" class="btmlogospace"&gt;Site is designed, hosted
                  and maintained by National Informatics Centre&lt;br /&gt; Contents on
                  this website is owned,updated and managed by the Ministry of
                  Panchayati Raj&lt;/td&gt;
          &lt;/tr&gt;
  &lt;/table&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  
  
  &lt;/div&gt;
  
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>