Парсер цены Python BS4
[![Страница][1]][1]
Необходимо спарсить цену 49990 без "Р" и чтобы это было число,а не текст [1]: https://i.stack.imgur.com/EAbGt.png
Ответы (1 шт):
Автор решения: Влад Дутчак
→ Ссылка
Вроде как работает :D
import requests,fake_useragent
from bs4 import BeautifulSoup
url = 'https://shop.mts.ru/product/smartfon-apple-iphone-11-new-128gb-fioletovyj'
user_agent = {'user-agent':fake_useragent.UserAgent().random}
responsive = requests.get(url, headers = user_agent)
html = BeautifulSoup(responsive.text, 'html.parser')
information = html.find('span',class_='product-price__current').get_text(strip=True)
price = ''
for i in information:
if i.isdigit():
price += i
print(price)