#! usr/bin python3 import csv import urllib.request from bs4 import BeautifulSoup def get_html(url): response = urllib.request.urlopen(url) return response.read() def parse(html): soup = BeautifulSoup(html) search = soup.find('div', class_='search-total js-search-total') span = soup.find('span', class_='search-message js-page-title') spantext = span.text searchtext = search.text print(spantext, searchtext) def save(searchtext, spantext, path): with open(path, 'w') as csvfile: writer = csv.writer(csvfile) writer.writerow(('Название', 'Кол-во')) writer.writerow((spantext['Название'], searchtext['Кол-во'])) save ('project.csv') def main(): parse(get_html('http://www.abitant.com/catalogues/bra-i-nastennye-svetilniki/companies/robers')) if __name__ == '__main__': main() Mistake:
TypeError: save() missing 2 required positional arguments: 'spantext' and 'path' Guys, I do not understand how to save the data in a csv file, please help.