首页 > 解决方案 > 有什么办法可以修复不良货币读取?

问题描述

我想用我的python和beautifulsoup在steam社区市场上刮掉物品的价格,但是当我刮掉一个时,货币最终变成瑞典克朗,有什么办法可以将其更改为欧元?

from bs4 import BeautifulSoup
import requests

html_text = requests .get('https://steamcommunity.com/market/listings/730/USP-S%20%7C%20Blueprint%20%28Factory%20New%29').text
soup = BeautifulSoup(html_text, 'lxml')
skin_name = soup.find('span', class_ = 'market_listing_item_name').text
sm = soup.find('span', class_ = 'market_listing_price').text.replace('                      ','sm ')

print(skin_name, sm)

标签: pythonbeautifulsoupcurrency

解决方案


推荐阅读