if card.find( "div", {"class": lambda x: x and "geo-georeferences" in x}): item["adress"] = card.find("div", { "class": lambda x: x and "geo-georeferences" in x }).span.text else: item["adress"] = "Не указан" item["url"] = "https://www.avito.ru" + card.find( "a")["href"] # print(item["url"]) item["id"] = int(item["url"].replace( "?src=bp_catalog", "").split("_")[-1]) it = Items.get_or_none(Items.item_id == item["id"]) urls_all.append(item["url"]) print(item) if it is None: print("Find new car", item["name"]) Items.create(item_id=item["id"], cost=item["cost"]) else: if int(it.cost) != int(item["cost"]): print(it.cost, item["cost"]) alarm(item, it.cost, item["cost"]) it.cost = item["cost"] it.save() print(f"Checked {len(cards)}") time.sleep(random.randint(60, 70))