RE: Use BeautifulSoup to delete certain tag while keeping its content

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bruce

    RE: Use BeautifulSoup to delete certain tag while keeping its content

    hi jackie,

    if you don't mind... can i ask what you're looking to accomplish? are you
    looking to simply get the text/string data, or something else???



    -----Original Message-----
    From: python-list-bounces+bedougl as=earthlink.ne t@python.org
    [mailto:python-list-bounces+bedougl as=earthlink.ne t@python.org]On Behalf
    Of Jackie Wang
    Sent: Saturday, September 06, 2008 8:12 AM
    To: python-list@python.org
    Subject: Use BeautifulSoup to delete certain tag while keeping its
    content


    Dear all,

    I have the following html code:

    <td valign="top" headers="col1">
    <font size="2">
    Center Bank
    <br />
    Los Angeles, CA
    </font>
    </td>

    <td valign="top" headers="col1">
    <font size="2">
    Salisbury
    Bank and Trust Company
    <font face="arial, helvetica" size="2" color="#0000000 ">
    <br />
    Lakeville, CT
    </font>
    </font>
    </td>

    How should I delete the 'font' tags while keeping the content inside?
    Ideally I want to get:

    <td valign="top" headers="col1">
    Center Bank
    <br />
    Los Angeles, CA
    </td>

    <td valign="top" headers="col1">
    Salisbury
    Bank and Trust Company
    <br />
    Lakeville, CT
    </td>

    Thank you.

    Jackie
    --


Working...