<br><br><div class="gmail_quote">On Wed, Jan 5, 2011 at 2:58 PM, Selvam <span dir="ltr"><<a href="mailto:s.selvamsiva@gmail.com">s.selvamsiva@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi all,<div><br></div><div>I am trying to parse some html string with BeatifulSoup.</div><div><br></div><div>The string is,</div><div><br><div><div>    <table colWidths='530.0' style='Table_Main_Table'></div>

<div>      <tr></div><div>        <td></div><div>          <blockTable colWidths='54.0,80.0,67.0' style='Table_Tax_Header'></div><div>            <tr></div><div>              <th></div>

<div>              <p style='terp_tblheader_Details_Centre'>Tax</p></th></div><div>              <th></div><div>              <p style='terp_tblheader_Details_Right'>Base</p></th></div>

<div>              <th></div><div>            <p style='terp_tblheader_Details_Right'>Amount</p></th></div><div>            </tr></div><div>          </blockTable></div><div>        </td></div>

<div>      </tr></div></div><div>   </table></div><div><br></div><div><br></div><div>rtables=soup.findAll(re.compile('table$'))</div><div><br></div><div>The rtables is,</div><div><br></div><div><div>[<table colwidths="530.0" style="Table_Main_Table"></div>

<div><tr></div><div><td></div><div><blocktable colwidths="54.0,80.0,67.0" style="Table_Tax_Header"></div><div></blocktable></td></tr><tr></div><div><th></div>

<div><p style="terp_tblheader_Details_Centre">Tax</p></th></div><div><th></div><div><p style="terp_tblheader_Details_Right">Base</p></th></div><div><th></div>

<div><p style="terp_tblheader_Details_Right">Amount</p></th></div><div></tr></div><div></table>, <blocktable colwidths="54.0,80.0,67.0" style="Table_Tax_Header"></div>

<div></blocktable>]</div></div><div><br></div><div><br></div><div><br></div><div>The tr inside the blocktable are appearing inside the table, while blocktable contains nothing.</div><div><br></div><div>Is there any way, I can get the tr in the right place (inside blocktable) ?</div>

<div><br>-- <br>Regards,<br>S.Selvam<br>SG E-ndicus Infotech Pvt Ltd.<br><a href="http://e-ndicus.com/" target="_blank">http://e-ndicus.com/</a><br><br> " I am because we are "<br>
</div></div>
</blockquote></div><div><br></div>Replying to myself,<div><br></div><div>BeautifulSoup.BeautifulSoup.NESTABLE_TABLE_TAGS['tr'].append('blocktable')<br><br></div><div>adding this, solved the issue.<br clear="all">
<br>-- <br>Regards,<br>S.Selvam<br>SG E-ndicus Infotech Pvt Ltd.<br><a href="http://e-ndicus.com/" target="_blank">http://e-ndicus.com/</a><br><br> " I am because we are "<br>
</div>