python - 解析俄罗斯站点编码错误
问题描述
解析网站时编码有问题https://beton24.ru/sochi/beton/
from urllib.request import urlopen
from bs4 import BeautifulSoup
html = urlopen('https://beton24.ru/sochi/beton/')
bs = BeautifulSoup(html.read())
result = bs.findAll("span", "catalog-index__link-text")[1]
parse = str(result)
为了得到混凝土的价格,我将结果转换为str,它变成了'from \ xa03 \ u2009836 \ xa0₽'
谁遇到过,怎么解决?谢谢!
解决方案
我想你想要的是:
parse = result.text
推荐阅读
- android - 获取 removeGhost 方法失败
- matlab - 批量文件重命名:如何保留文件名的顺序?
- pandas - 直方图上的异常条(熊猫)
- visual-studio-code - VS Code 中的“自动可选链完成”是什么时候触发的?
- python-3.x - 如何在 Python 3x 中比较重复索引会导致长度不同的列表范围
- javascript - 错误:在多个 render() 操作期间无法使用相同的画布。PDF.js 问题
- javascript - Vue 两次导入相同的组件/ Vue 事件从子级只到根,而不是到父级
- python - 将向量从 C++ 返回到 Python,而不使用 SWIG 进行复制
- python-3.x - Python:使用子字符串对列表进行排序
- selenium - 通过 Selenium 启动 ChromeDriver 时,控制台中显示的字母数字字符串代表什么?