如何寻找靓汤串

2024-09-30 03:23:37 发布

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

1条回答
网友
1楼 · 发布于 2024-09-30 03:23:37

方法之一是:

from bs4 import BeautifulSoup
soup = BeautifulSoup(yourhtml)
span = soup.find('span', {'class': 'sr_gs_rackrate_total'})
b = span.parent
b.span.extract()
b.text

如果有多个跨度包含价格,则使用

^{pr2}$

相关问题 更多 >

    热门问题