解析网站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₽'
面对谁,如何解决?谢谢!
答案 0 :(得分:2)
我认为您想要的是:
parse = result.text