Compare commits

...

2 Commits

Author SHA1 Message Date
7b7f216be8 Merge branch 'main' of https://mcstn.fr/gitea/Yann/Projet2
je ne sais pas vraiment ce que ça va faire... j'ai commit, push puis
amend mon commit local... j'essaye de sync
2024-11-13 13:38:13 +01:00
3a6cf9b87e remove url_base, refactor list get_data, fix comment and PEP8 2024-11-13 11:06:11 +01:00

View File

@ -53,7 +53,17 @@ def get_data(soup, url):
#write the file
def data_output(info, file):
fieldnames = ['product_page_url', 'universal_ product_code (upc)', 'title', 'price_including_tax', 'price_excluding_tax', 'number_available', 'product_description', 'category', 'review_rating', 'image_url']
fieldnames = ['product_page_url',
'universal_ product_code (upc)',
'title',
'price_including_tax',
'price_excluding_tax',
'number_available',
'product_description',
'category',
'review_rating',
'image_url']
with open(file, 'w') as csv_file:
writer = csv.writer(csv_file, delimiter = ',')
writer.writerow(fieldnames)