python - 有什么办法可以修复不良货币读取?
问题描述
我想用我的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)
解决方案
推荐阅读
- c++11 - unique_ptr 是什么意思
::operator= 在解除分配方面做 - php - 我想测试与本地托管的 MySQL 数据库的连接 - 远程
- python - Scrapy从没有标题的表中提取行
- crystal-lang - 从 JSON 参数创建 Granite 模型
- java - 根据月份名称首先出现的格式获取日期
- javascript - Sparx Enterprise Achitect 中的包 ID
- bootstrap-4 - 删除 div 时的引导网格布局
- javascript - window.scrollTo 选项不适用于 Microsoft Edge
- c# - 直接将 C# 值赋值给对象引用
- apache-zeppelin - Zeppelin 中经过身份验证的 Rest 调用