import requests
from bs4 import BeautifulSoup
import csv
url = "http://www.ilife.if.ua/show_cat.php?catid=21675&grid=1154"
r = requests.get(url)
soup = BeautifulSoup(r.content, 'html.parser')
phone_name = soup.find_all("a", attrs={"class": "tov"})
list_of = []
for item in phone_name:
name = item.text
print name
list_of.append(name)
with open('index.csv', 'w') as csv_file:
writer = csv.writer(csv_file)
writer.writerow(name)
print list_of
Перемещено leave из web-development