i made this web scraper in reference to a school project. And i am trying to get all my scraped information printed out in a form/table into excel. at the beginning of my code i am opening a csv file and writing the rows that i want by using the
import csv csv_file = open('cms_example.csv', 'w') csv_writer = csv.writer(csv_file) csv_writer.writerow(['Type-navn', 'Markedspris', 'Pris', 'Tilbud', 'Rabat', 'Link'])at the buttom i am putting all the variabels in to rows lik so:
csv_writer.writerow( [name, Old_price, regular_price, new_price, Rabat, link]) csv_file.close()I have seen this video: https://www.youtube.com/watch?v=ng2o98k983k by corey schafer and i am opening, writing and closing the csv file as showed in this video. but of som how i can't get the scraped information under the right columns in excel. plus some of the scraped titles get deleted. i have tried to do the "from text to columns" process in excel and i have tried to import the csv file directly into the excel sheet. but i really can't figure out why all the information isn't under the right columns. how do i do this?
buran write Jan-27-2021, 03:59 PM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.