关闭输出<br>

2024-10-04 03:18:54 发布

您现在位置:Python中文网/ 问答频道 /正文

我想获取网络信息:

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

使用硒:

customer_address_u = browser.find_element_by_id("dnn_ctr778_MyAccountInfo_lblFormattedAddrExternal")
customer_address = customer_address_u.text

输出为:

1000 Nicollet Mall
TPS-2086
Minneapolis, MN 55403

我怎样才能在一条线上完成呢?你知道吗

1000 Nicollet Mall TPS-2086 Minneapolis, MN 55403

Tags: br网络idaddresscustomerspanmndnn