python去除html空格

如下面的

1 <td>&nbsp;柳暗花溟</td>

html里面的空格&nbsp,想直接用strip()函数去除是不可能的,必须显式的去掉\xa0

例如以上的就可以这样的方式去除空格

1 author = author.strip("\n\r    \xa0")

记录一下。