fork download
  1. import re, ast, html
  2. s = r"""{'price': '<script type="text/javascript">document.write;icon_top_2_iphone"></span>Безопасная сделка</a> 10&nbsp;000&nbsp;₽ </div>\');</script'}"""
  3. d = ast.literal_eval(s)
  4. m = re.search(r'(?<!\d)\d{1,3}(?:\xA0\d{3})*\s*₽', html.unescape(d["price"]))
  5. if m:
  6. print( m.group() )
Success #stdin #stdout 0.02s 10508KB
stdin
Standard input is empty
stdout
10 000 ₽