selenium python输出关闭<;br>;

selenium python输出关闭<;br>;,python,selenium,Python,Selenium,我想获取网络信息: <span id="dnn_ctr778_MyAccountInfo_lblFormattedAddrExternal">1000 Nicollet Mall <br>TPS-2086<br>Minneapolis, MN 55403</span> 输出为: 1000 Nicollet Mall TPS-2086 Minneapolis, MN 55403 我怎样才能在一条线上完成 1000 Nicollet Mall TP

我想获取网络信息:

<span id="dnn_ctr778_MyAccountInfo_lblFormattedAddrExternal">1000 Nicollet Mall <br>TPS-2086<br>Minneapolis, MN 55403</span>
输出为:

1000 Nicollet Mall
TPS-2086
Minneapolis, MN 55403
我怎样才能在一条线上完成

1000 Nicollet Mall TPS-2086 Minneapolis, MN 55403

最简单的方法是用如下空格替换所有
\n
customer\u address=customer\u address\u.text.replace('\n','.strip()
)。但这可能不是您正在寻找的正确解决方案?最简单的方法是将所有
\n
替换为如下空格:
customer\u address=customer\u address\u.text.replace('\n','.strip()
)。但也许这不是你想要的正确解决方案?
1000 Nicollet Mall TPS-2086 Minneapolis, MN 55403