On 3 Mar 2006 00:20:21 -0800, P Boy <[EMAIL PROTECTED]> wrote:
As others have mentioned , you really need a an HTML parser. But the following would work better than strip()
>>> a = ' <TD WIDTH=175><FONT SIZE=2>Hughes. John</FONT></TD>\r\n'
>>> a.replace(' <TD WIDTH=175><FONT SIZE=2>', '' ) # '' = 2 single quotes not 1 double quote
'Hughes. John</FONT></TD>\r\n'
HTH :)
This seems like a web page parsing question. Another approach can be as
follows if you know the limiting token strings:
a.split(' <TD WIDTH=175><FONT
SIZE=2>')[1].split('</FONT></TD>\r\n')[0]
As others have mentioned , you really need a an HTML parser. But the following would work better than strip()
>>> a = ' <TD WIDTH=175><FONT SIZE=2>Hughes. John</FONT></TD>\r\n'
>>> a.replace(' <TD WIDTH=175><FONT SIZE=2>', '' ) # '' = 2 single quotes not 1 double quote
'Hughes. John</FONT></TD>\r\n'
HTH :)
--
Tim Williams
-- http://mail.python.org/mailman/listinfo/python-list