Парсинг на одних регулярках - Python
Формулировка задачи:
проблемы с картинками
Решение задачи: «Парсинг на одних регулярках»
textual
Листинг программы
from bs4 import BeautifulSoup
import requests
url = 'http://rozetka.com.ua/mobile-phones/c80003/filter/page=1;preset=smartfon/'
r = requests.get(url)
page = BeautifulSoup(r.text, "html.parser")
rows = page.findAll('div',{'class':"g-i-tile-i-title clearfix"})
names = []
for name in rows:
names.append(name.text)
for i in names:
print(i.strip())
rows = page.findAll('div',{'class':"g-price-uah"})
prices = []
for price in rows:
prices.append(price.text)
for i in prices:
print(i)