python - Transform content to String in Python 3 using BeautifulSoup
问题描述
So, I have this:
<td>MBC: <b>0.01 €</b> EBC: <b>0.01 €</b> SC: <b>0.25 €</b> </td>
And I want a string that looks something like this:
MBS: 0.01€, EBC:0.01€, SC:0.25€</p>
How can I take the MBC, EBC and SC out of the ?
Thanks!
解决方案
您可以使用
text = soup.get_text()
print(text)
推荐阅读
- firebase - React Native Crash - Gray Screen - App Center build only - com.facebook.react.bridge.CatalystInstanceImpl.jniLoadScriptFromAssets(Native Method)
- excel - Excel VBA“编译错误预期语句结束”(括号问题)
- python - 数据库表中的 wy 未创建并显示此错误 在 Django 中无效的外键
- python - `sklearn` 在有 eval 数据集时询问
- php - Php + mysql - 在 66,946 个字符的查询输入后,连接始终中断
- python - 如何使用 Python 搜索具有给定参数的 JSON 文件?
- graphql - 变异输入在两个 Apollo GraphQL 联合服务之间拆分
- python - 如何使用python计算excel中价格列表的回报率?
- reactjs - 如何使用多个 API 显示表格
- c++ - Why is my code stopping prematurely? what have i done wrong?