напиши парсер цен на авито in python

main.py
import requests
from bs4 import BeautifulSoup

url = 'https://www.avito.ru/moskva?q=iphone'

response = requests.get(url)
soup = BeautifulSoup(response.text, 'html.parser')

items = soup.find_all('div', class_='item_table')

for item in items:
    title = item.find('h3', class_='title').text.strip()
    price = item.find('span', class_='price').text.strip()
    
    print(f'Title: {title}\nPrice: {price}\n')
412 chars
16 lines

related categories

gistlibby LogSnag