有什么办法可以修复错误的货币读取吗?

时间:2021-05-17 19:29:18

标签: python beautifulsoup currency

我想用我的蟒蛇和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)

0 个答案:

没有答案