首页 > 解决方案 > 解析俄罗斯站点编码错误

问题描述

解析网站时编码有问题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₽'

谁遇到过,怎么解决?谢谢!

标签: pythonpython-3.xparsingencodingbeautifulsoup

解决方案


我想你想要的是:

parse = result.text

推荐阅读