Created
November 19, 2021 16:51
-
-
Save mohammedouahman/81421a24cbff1e58f674f6232fd10d47 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
results = [] | |
for i in range(1, no_pages+1): | |
results.append(get_data(i)) | |
flatten = lambda l: [item for sublist in l for item in sublist] | |
df = pd.DataFrame(flatten(results),columns=['Book Name','Author','Rating','Customers_Rated', 'Price']) | |
df.to_csv('amazon_products.csv', index=False, encoding='utf-8') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment