├── .gitignore ├── test_book_ids.txt ├── requirements.txt ├── test_scripts.sh ├── goodreads_classics_sample.txt ├── most_popular_classics.txt ├── goodreads_classics.txt ├── README.md ├── get_books.py ├── get_reviews.py ├── LICENSE └── How-To-Use-Goodreads-Scraper.ipynb /.gitignore: -------------------------------------------------------------------------------- 1 | test-output/test-books/* 2 | test-output/test-reviews/* 3 | geckodriver.log 4 | .DS_Store -------------------------------------------------------------------------------- /test_book_ids.txt: -------------------------------------------------------------------------------- 1 | 374233.If_on_a_Winter_s_Night_a_Traveler 2 | 18839.Orlando 3 | 79550.The_Summer_Book -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | beautifulsoup4 2 | selenium 3 | lxml 4 | geckodriver-autoinstaller 5 | chromedriver-py 6 | pandas 7 | regex 8 | credentials 9 | -------------------------------------------------------------------------------- /test_scripts.sh: -------------------------------------------------------------------------------- 1 | mkdir -p test-output 2 | mkdir -p test-output/test-books 3 | mkdir -p test-output/test-reviews 4 | 5 | python get_books.py --book_ids_path test_book_ids.txt --output_directory_path test-output/test-books 6 | 7 | python get_reviews.py --book_ids_path test_book_ids.txt --output_directory_path test-output/test-reviews --sort_order 0 --browser firefox -------------------------------------------------------------------------------- /goodreads_classics_sample.txt: -------------------------------------------------------------------------------- 1 | 1885.Pride_and_Prejudice 2 | 2657.To_Kill_a_Mockingbird 3 | 4671.The_Great_Gatsby 4 | 10210.Jane_Eyre 5 | 1371.The_Iliad 6 | 6185.Wuthering_Heights 7 | 5107.The_Catcher_in_the_Rye 8 | 11337.The_Bluest_Eye 9 | 320.One_Hundred_Years_of_Solitude 10 | 36529.Narrative_of_the_Life_of_Frederick_Douglass 11 | 1934.Little_Women 12 | 12296.The_Scarlet_Letter 13 | 18423.The_Left_Hand_of_Darkness 14 | 14942.Mrs_Dalloway 15 | 38447.The_Handmaid_s_Tale -------------------------------------------------------------------------------- /most_popular_classics.txt: -------------------------------------------------------------------------------- 1 | 1885.Pride_and_Prejudice 2 | 2657.To_Kill_a_Mockingbird 3 | 4671.The_Great_Gatsby 4 | 10210.Jane_Eyre 5 | 40961427-1984 6 | 6185.Wuthering_Heights 7 | 5107.The_Catcher_in_the_Rye 8 | 170448.Animal_Farm 9 | 18135.Romeo_and_Juliet 10 | 7624.Lord_of_the_Flies 11 | 35031085-frankenstein 12 | 890.Of_Mice_and_Men 13 | 1934.Little_Women 14 | 5297.The_Picture_of_Dorian_Gray 15 | 14935.Sense_and_Sensibility 16 | 6969.Emma 17 | 2956.The_Adventures_of_Huckleberry_Finn 18 | 13079982-fahrenheit-451 19 | 1953.A_Tale_of_Two_Cities 20 | 12296.The_Scarlet_Letter 21 | 2623.Great_Expectations 22 | 17245.Dracula 23 | 2156.Persuasion 24 | 7126.The_Count_of_Monte_Cristo 25 | 1381.The_Odyssey 26 | 5129.Brave_New_World 27 | 15823480-anna-karenina 28 | 1420.Hamlet 29 | 5907.The_Hobbit_or_There_and_Back_Again 30 | 5326.A_Christmas_Carol 31 | 8852.Macbeth 32 | 2998.The_Secret_Garden 33 | 7144.Crime_and_Punishment 34 | 24280.Les_Mis_rables 35 | 24583.The_Adventures_of_Tom_Sawyer 36 | 50398.Northanger_Abbey 37 | 48855.The_Diary_of_a_Young_Girl 38 | 2165.The_Old_Man_and_the_Sea 39 | 18114322-the-grapes-of-wrath 40 | 157993.The_Little_Prince 41 | 18405.Gone_with_the_Wind 42 | 45032.Mansfield_Park 43 | 8127.Anne_of_Green_Gables 44 | 4981.Slaughterhouse_Five 45 | 1622.A_Midsummer_Night_s_Dream 46 | 153747.Moby_Dick_or_the_Whale 47 | 7604.Lolita 48 | 51496.The_Strange_Case_of_Dr_Jekyll_and_Mr_Hyde 49 | 24213.Alice_s_Adventures_in_Wonderland_Through_the_Looking_Glass 50 | 1371.The_Iliad -------------------------------------------------------------------------------- /goodreads_classics.txt: -------------------------------------------------------------------------------- 1 | 1885.Pride_and_Prejudice 2 | 14942.Mrs_Dalloway 3 | 170448.Animal_Farm 4 | 251688.Breakfast_at_Tiffany_s 5 | 10799.A_Farewell_to_Arms 6 | 2547.The_Prophet 7 | 7144.Crime_and_Punishment 8 | 54479.Around_the_World_in_Eighty_Days 9 | 12948.The_Turn_of_the_Screw 10 | 5326.A_Christmas_Carol 11 | 2696.The_Canterbury_Tales 12 | 35031085-frankenstein 13 | 1852.The_Call_of_the_Wild 14 | 2932.Robinson_Crusoe 15 | 50.Hatchet 16 | 4934.The_Brothers_Karamazov 17 | 3876.The_Sun_Also_Rises 18 | 1420.Hamlet 19 | 59151.Chess_Story 20 | 45032.Mansfield_Park 21 | 36402034-do-androids-dream-of-electric-sheep 22 | 50398.Northanger_Abbey 23 | 18254.Oliver_Twist 24 | 36529.Narrative_of_the_Life_of_Frederick_Douglass 25 | 24213.Alice_s_Adventures_in_Wonderland_Through_the_Looking_Glass 26 | 4900.Heart_of_Darkness 27 | 18135.Romeo_and_Juliet 28 | 16299.And_Then_There_Were_None 29 | 5107.The_Catcher_in_the_Rye 30 | 37781.Things_Fall_Apart 31 | 92303.The_Importance_of_Being_Earnest 32 | 2175.Madame_Bovary 33 | 1934.Little_Women 34 | 114437.Address_Unknown 35 | 7126.The_Count_of_Monte_Cristo 36 | 2623.Great_Expectations 37 | 7604.Lolita 38 | 46787.Uncle_Tom_s_Cabin 39 | 1381.The_Odyssey 40 | 30597.The_Hunchback_of_Notre_Dame 41 | 38447.The_Handmaid_s_Tale 42 | 11337.The_Bluest_Eye 43 | 3836.Don_Quixote 44 | 295.Treasure_Island 45 | 16343.The_Mysterious_Affair_at_Styles 46 | 320.One_Hundred_Years_of_Solitude 47 | 19380.Candide 48 | 81959.As_a_Man_Thinketh 49 | 2956.The_Adventures_of_Huckleberry_Finn 50 | 3008.A_Little_Princess 51 | 332613.One_Flew_Over_the_Cuckoo_s_Nest 52 | 286957.The_Yellow_Wall_Paper 53 | 52357.Beowulf 54 | 231804.The_Outsiders 55 | 2165.The_Old_Man_and_the_Sea 56 | 236093.The_Wonderful_Wizard_of_Oz 57 | 10210.Jane_Eyre 58 | 52036.Siddhartha 59 | 24583.The_Adventures_of_Tom_Sawyer 60 | 656.War_and_Peace 61 | 6952.Like_Water_for_Chocolate 62 | 121749.Prince_Caspian 63 | 14935.Sense_and_Sensibility 64 | 40940649-i-am-legend 65 | 5297.The_Picture_of_Dorian_Gray 66 | 12996.Othello 67 | 7190.The_Three_Musketeers 68 | 4406.East_of_Eden 69 | 480204.The_Phantom_of_the_Opera 70 | 11588.The_Shining 71 | 890.Of_Mice_and_Men 72 | 49552.The_Stranger 73 | 4981.Slaughterhouse_Five 74 | 18386.The_Death_of_Ivan_Ilych 75 | 41817486-a-clockwork-orange 76 | 8852.Macbeth 77 | 65605.The_Magician_s_Nephew 78 | 2998.The_Secret_Garden 79 | 100915.The_Lion_the_Witch_and_the_Wardrobe 80 | 2493.The_Time_Machine 81 | 51496.The_Strange_Case_of_Dr_Jekyll_and_Mr_Hyde 82 | 485894.The_Metamorphosis 83 | 48855.The_Diary_of_a_Young_Girl 84 | 5129.Brave_New_World 85 | 15823480-anna-karenina 86 | 6185.Wuthering_Heights 87 | 5907.The_Hobbit_or_There_and_Back_Again 88 | 24280.Les_Mis_rables 89 | 12296.The_Scarlet_Letter 90 | 37415.Their_Eyes_Were_Watching_God 91 | 3636.The_Giver 92 | 1622.A_Midsummer_Night_s_Dream 93 | 7733.Gulliver_s_Travels 94 | 18512.The_Return_of_the_King 95 | 8127.Anne_of_Green_Gables 96 | 39988.Matilda 97 | 5308.The_Pearl 98 | 18144590-the-alchemist 99 | 157993.The_Little_Prince 100 | 853510.Murder_on_the_Orient_Express 101 | 17899948-rebecca 102 | 6324090-alice-s-adventures-in-wonderland 103 | 168642.In_Cold_Blood 104 | 1953.A_Tale_of_Two_Cities 105 | 216363.The_Man_in_the_High_Castle 106 | 11486.The_Color_Purple 107 | 18114322-the-grapes-of-wrath 108 | 17250.The_Crucible 109 | 102868.A_Study_in_Scarlet 110 | 36576608-flowers-for-algernon 111 | 4671.The_Great_Gatsby 112 | 3431.The_Five_People_You_Meet_in_Heaven 113 | 24178.Charlotte_s_Web 114 | 18423.The_Left_Hand_of_Darkness 115 | 32261.Tess_of_the_D_Urbervilles 116 | 18521.A_Room_of_One_s_Own 117 | 44767458-dune 118 | 6969.Emma 119 | 131359.Death_on_the_Nile 120 | 17245.Dracula 121 | 84119.The_Horse_and_His_Boy 122 | 40961427-1984 123 | 6900.Tuesdays_with_Morrie 124 | 7624.Lord_of_the_Flies 125 | 133518.The_Things_They_Carried 126 | 32829.Journey_to_the_Center_of_the_Earth 127 | 2156.Persuasion 128 | 153747.Moby_Dick_or_the_Whale 129 | 168668.Catch_22 130 | 34.The_Fellowship_of_the_Ring 131 | 639787.The_Murder_on_the_Links 132 | 8909.The_War_of_the_Worlds 133 | 18405.Gone_with_the_Wind 134 | 28862.The_Prince 135 | 13079982-fahrenheit-451 136 | 6514.The_Bell_Jar 137 | 15241.The_Two_Towers 138 | 71728.Jonathan_Livingston_Seagull 139 | 58696.David_Copperfield 140 | 14891.A_Tree_Grows_in_Brooklyn 141 | 2657.To_Kill_a_Mockingbird 142 | 1371.The_Iliad 143 | 34268.Peter_Pan 144 | 12957.Much_Ado_About_Nothing 145 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Goodreads Scraper 2 | 3 | These Python scripts can be used to collect book reviews and metadata from Goodreads. 4 | 5 | We were motivated to develop this Goodreads Scraper because the Goodreads API is difficult to work with and does not provide access to the full text of reviews. The Goodreads Scraper instead uses the web scraping libraries [Beautiful Soup](https://www.crummy.com/software/BeautifulSoup/bs4/doc/#installing-beautiful-soup) and [Selenium](https://selenium-python.readthedocs.io/installation.html) to collect data. 6 | 7 | We used this Goodreads Scraper to collect data for our article, "The Goodreads ‘Classics’: A Computational Study of Readers, Amazon, and Crowdsourced Literary Criticism." To allow others to reproduce (approximately) the data we used in the essay, we include a file with 144 Goodreads book IDs for the 144 classics that we analyzed (`goodreads_classics.txt`). You can use these IDs to collect corresponding reviews and metadata with the Goodreads Scraper as described below. 8 | 9 | *Note: Updates to the Goodreads website may break this code. We don't guarantee that the scraper will continue to work in the future, but feel free to post an issue if you run into a problem.* 10 | 11 |

12 | 13 | # What You Need 14 | 15 | To run these scripts, you will need [Python 3](https://www.anaconda.com/distribution/). 16 | 17 | You will also need the following Python libraries: 18 | - [Beautiful Soup 4](https://www.crummy.com/software/BeautifulSoup/bs4/doc/#installing-beautiful-soup) 19 | - [Selenium](https://selenium-python.readthedocs.io/installation.html) 20 | - [lxml](https://www.crummy.com/software/BeautifulSoup/bs4/doc/#installing-a-parser) 21 | - [geckodriver-autoinstaller](https://pypi.org/project/geckodriver-autoinstaller/) 22 | - [chromedriver-py](https://pypi.org/project/chromedriver-py/) 23 | 24 | You can install these Python libraries by running `pip install -r requirements.txt` 25 | 26 | Finally, you will need a web browser — either Chrome or Firefox. We have found that the Goodreads Scraper tends to function better with Firefox. 27 | 28 |

29 | 30 | # Tutorial 31 | 32 | We recommend running these Python scripts from the command line, as the usage instructions below describe. However, we have also created a [Jupyter notebook tutorial](https://github.com/maria-antoniak/goodreads-scraper/blob/master/How-To-Use-Goodreads-Scraper.ipynb) that demonstrates how to use the Goodreads Scraper scripts. Please note that these scripts may not work consistently from a Jupyter notebook environment and that the tutorial is mostly intended for demonstration purposes. 33 |

34 | 35 | # Scraping Goodreads Book Metadata 36 | 37 | You can use the Python script `get_books.py` to collect metadata about books on Goodreads, such as the total number of Goodreads reviews and ratings, average Goodreads rating, and most common Goodreads "shelves" for each book. 38 | 39 | ## get_books.py 40 | 41 | ### Input 42 | 43 | This script takes as input a list of book IDs, stored in a plain text file with one book ID per line. Book IDs are unique to Goodreads and can be found at the end of a book's URL. For example, the book ID for *Little Women* ([https://www.goodreads.com/book/show/1934.Little_Women](https://www.goodreads.com/book/show/1934.Little_Women)) is `1934.Little_Women`. 44 | 45 | ### Output 46 | 47 | This script outputs a JSON file for each book with the following information: 48 | 49 | - book ID and title 50 | - book ID 51 | - book title 52 | - ISBN 53 | - ISBN13 54 | - year the book was first published 55 | - title 56 | - author 57 | - number of pages in the book 58 | - genres 59 | - top shelves 60 | - lists 61 | - total number of ratings 62 | - total number of reviews 63 | - average rating 64 | - rating distribution 65 | 66 | This script also outputs an aggregated JSON file with information about all the books that have been scraped. To output an aggregated CSV file in addition to a JSON file, use the flag `--format CSV`. 67 | 68 | ### Usage 69 | 70 | `python get_books.py --book_ids_path your_file_path --output_directory_path your_directory_path --format JSON (default) or CSV` 71 | 72 | ### Example 73 | 74 | `python get_books.py --book_ids_path most_popular_classics.txt --output_directory_path goodreads_project/classic_book_metadata --format CSV` 75 | 76 |

77 | 78 | # Scraping Goodreads Book Reviews 79 | 80 | You can use the Python script `get_reviews.py` to collect reviews and review metadata about books on Goodreads, including the text of the review, star rating, username of the reviewer, number of likes, and categories or "shelves" that the user has tagged for the book. 81 | 82 | ## get_reviews.py 83 | 84 | ### Input 85 | 86 | This script takes as input a list of book IDs, stored in a plain text file with one book ID per line. Book IDs are unique to Goodreads and can be found at the end of a book's URL. For example, the book ID for *Little Women* ([https://www.goodreads.com/book/show/1934.Little_Women](https://www.goodreads.com/book/show/1934.Little_Women)) is `1934.Little_Women`. 87 | 88 | ### Output 89 | 90 | This script outputs a JSON file for each book with the following information: 91 | - book ID and title 92 | - book ID 93 | - book title 94 | - review URL 95 | - review ID 96 | - date 97 | - rating 98 | - username of the reviewer 99 | - text 100 | - number of likes the review received from other users 101 | - shelves to which the reviewer added the book 102 | 103 | This script also outputs an aggregated JSON file with information about all the reviews for all the books that have been scraped. To output an aggregated CSV file in addition to a JSON file, use the flag `--format CSV`. 104 | 105 | Goodreads only allows the first 10 pages of reviews to be shown for each book. There are 30 reviews per page, so you should expect a maximum of 300 reviews per book. By default, the reviews are sorted by their popularity. They can also be sorted chronologically to show either the newest or oldest reviews. 106 | 107 | We also select a filter to only show English language reviews. 108 | 109 | ### Usage 110 | 111 | `python get_reviews.py --book_ids_path your_file_path --output_directory_path your_directory_path --browser your_browser_name --sort_order your_sort_order --format JSON (default) or CSV` 112 | 113 | `sort_order` can be set to `default`,`newest` or `oldest`. 114 | 115 | `browser` can be set to `chrome` or `firefox`. 116 | 117 | `format` can be set to `JSON` (default) or `CSV`. 118 | 119 | ### Example 120 | 121 | `python get_reviews.py --book_ids_path most_popular_classics.txt --output_directory_path goodreads_project/classic_book_reviews --sort_order default --browser chrome` 122 | 123 |

124 | 125 | # Test 126 | 127 | You can run the provided test script to check that everything is working correctly. 128 | 129 | `./test_scripts.sh` 130 | 131 | This will create a directory called `test-output` in which you'll find the scraped books and reviews. 132 | 133 |

134 | 135 | # Credit 136 | 137 | This code is written by Maria Antoniak and Melanie Walsh. The code is licensed under a [GNU General Public License v3.0](https://choosealicense.com/licenses/gpl-3.0/#). 138 | 139 | If you use this scraper, we'd love to hear about your project and how you use the code. 140 | 141 | We used a function written by [Omar Einea](https://github.com/OmarEinea/GoodReadsScraper), licensed under [GPL v3.0](https://github.com/OmarEinea/GoodReadsScraper/blob/master/LICENSE.md), for the Goodreads review sorting. 142 | 143 | -------------------------------------------------------------------------------- /get_books.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | from datetime import datetime 3 | import json 4 | import os 5 | import re 6 | import time 7 | 8 | from urllib.request import urlopen 9 | from urllib.error import HTTPError 10 | import bs4 11 | import pandas as pd 12 | 13 | 14 | def get_all_lists(soup): 15 | 16 | lists = [] 17 | list_count_dict = {} 18 | 19 | if soup.find('a', text='More lists with this book...'): 20 | 21 | lists_url = soup.find('a', text='More lists with this book...')['href'] 22 | 23 | source = urlopen('https://www.goodreads.com' + lists_url) 24 | soup = bs4.BeautifulSoup(source, 'lxml') 25 | lists += [' '.join(node.text.strip().split()) for node in soup.find_all('div', {'class': 'cell'})] 26 | 27 | i = 0 28 | while soup.find('a', {'class': 'next_page'}) and i <= 10: 29 | 30 | time.sleep(2) 31 | next_url = 'https://www.goodreads.com' + soup.find('a', {'class': 'next_page'})['href'] 32 | source = urlopen(next_url) 33 | soup = bs4.BeautifulSoup(source, 'lxml') 34 | 35 | lists += [node.text for node in soup.find_all('div', {'class': 'cell'})] 36 | i += 1 37 | 38 | # Format lists text. 39 | for _list in lists: 40 | # _list_name = ' '.join(_list.split()[:-8]) 41 | # _list_rank = int(_list.split()[-8][:-2]) 42 | # _num_books_on_list = int(_list.split()[-5].replace(',', '')) 43 | # list_count_dict[_list_name] = _list_rank / float(_num_books_on_list) # TODO: switch this back to raw counts 44 | _list_name = _list.split()[:-2][0] 45 | _list_count = int(_list.split()[-2].replace(',', '')) 46 | list_count_dict[_list_name] = _list_count 47 | 48 | return list_count_dict 49 | 50 | 51 | def get_shelves(soup): 52 | 53 | shelf_count_dict = {} 54 | 55 | if soup.find('a', text='See top shelves…'): 56 | 57 | # Find shelves text. 58 | shelves_url = soup.find('a', text='See top shelves…')['href'] 59 | source = urlopen('https://www.goodreads.com' + shelves_url) 60 | soup = bs4.BeautifulSoup(source, 'lxml') 61 | shelves = [' '.join(node.text.strip().split()) for node in soup.find_all('div', {'class': 'shelfStat'})] 62 | 63 | # Format shelves text. 64 | shelf_count_dict = {} 65 | for _shelf in shelves: 66 | _shelf_name = _shelf.split()[:-2][0] 67 | _shelf_count = int(_shelf.split()[-2].replace(',', '')) 68 | shelf_count_dict[_shelf_name] = _shelf_count 69 | 70 | return shelf_count_dict 71 | 72 | 73 | def get_genres(soup): 74 | genres = [] 75 | for node in soup.find_all('div', {'class': 'left'}): 76 | current_genres = node.find_all('a', {'class': 'actionLinkLite bookPageGenreLink'}) 77 | current_genre = ' > '.join([g.text for g in current_genres]) 78 | if current_genre.strip(): 79 | genres.append(current_genre) 80 | return genres 81 | 82 | 83 | def get_series_name(soup): 84 | series = soup.find(id="bookSeries").find("a") 85 | if series: 86 | series_name = re.search(r'\((.*?)\)', series.text).group(1) 87 | return series_name 88 | else: 89 | return "" 90 | 91 | 92 | def get_series_uri(soup): 93 | series = soup.find(id="bookSeries").find("a") 94 | if series: 95 | series_uri = series.get("href") 96 | return series_uri 97 | else: 98 | return "" 99 | 100 | 101 | def get_isbn(soup): 102 | try: 103 | isbn = re.findall(r'nisbn: [0-9]{10}' , str(soup))[0].split()[1] 104 | return isbn 105 | except: 106 | return "isbn not found" 107 | 108 | def get_isbn13(soup): 109 | try: 110 | isbn13 = re.findall(r'nisbn13: [0-9]{13}' , str(soup))[0].split()[1] 111 | return isbn13 112 | except: 113 | return "isbn13 not found" 114 | 115 | 116 | def get_rating_distribution(soup): 117 | distribution = re.findall(r'renderRatingGraph\([\s]*\[[0-9,\s]+', str(soup))[0] 118 | distribution = ' '.join(distribution.split()) 119 | distribution = [int(c.strip()) for c in distribution.split('[')[1].split(',')] 120 | distribution_dict = {'5 Stars': distribution[0], 121 | '4 Stars': distribution[1], 122 | '3 Stars': distribution[2], 123 | '2 Stars': distribution[3], 124 | '1 Star': distribution[4]} 125 | return distribution_dict 126 | 127 | 128 | def get_num_pages(soup): 129 | if soup.find('span', {'itemprop': 'numberOfPages'}): 130 | num_pages = soup.find('span', {'itemprop': 'numberOfPages'}).text.strip() 131 | return int(num_pages.split()[0]) 132 | return '' 133 | 134 | 135 | def get_year_first_published(soup): 136 | year_first_published = soup.find('nobr', attrs={'class':'greyText'}).string 137 | return re.search('([0-9]{3,4})', year_first_published).group(1) 138 | 139 | def get_id(bookid): 140 | pattern = re.compile("([^.-]+)") 141 | return pattern.search(bookid).group() 142 | 143 | def scrape_book(book_id): 144 | url = 'https://www.goodreads.com/book/show/' + book_id 145 | source = urlopen(url) 146 | soup = bs4.BeautifulSoup(source, 'html.parser') 147 | 148 | time.sleep(2) 149 | 150 | return {'book_id_title': book_id, 151 | 'book_id': get_id(book_id), 152 | 'book_title': ' '.join(soup.find('h1', {'id': 'bookTitle'}).text.split()), 153 | "book_series": get_series_name(soup), 154 | "book_series_uri": get_series_uri(soup), 155 | 'isbn': get_isbn(soup), 156 | 'isbn13': get_isbn13(soup), 157 | 'year_first_published': get_year_first_published(soup), 158 | 'author': ' '.join(soup.find('span', {'itemprop': 'name'}).text.split()), 159 | 'num_pages': get_num_pages(soup), 160 | 'genres': get_genres(soup), 161 | 'shelves': get_shelves(soup), 162 | 'lists': get_all_lists(soup), 163 | 'num_ratings': soup.find('meta', {'itemprop': 'ratingCount'})['content'].strip(), 164 | 'num_reviews': soup.find('meta', {'itemprop': 'reviewCount'})['content'].strip(), 165 | 'average_rating': soup.find('span', {'itemprop': 'ratingValue'}).text.strip(), 166 | 'rating_distribution': get_rating_distribution(soup)} 167 | 168 | def condense_books(books_directory_path): 169 | 170 | books = [] 171 | 172 | for file_name in os.listdir(books_directory_path): 173 | if file_name.endswith('.json') and not file_name.startswith('.') and file_name != "all_books.json": 174 | _book = json.load(open(books_directory_path + '/' + file_name, 'r')) #, encoding='utf-8', errors='ignore')) 175 | books.append(_book) 176 | 177 | return books 178 | 179 | def main(): 180 | 181 | start_time = datetime.now() 182 | script_name = os.path.basename(__file__) 183 | 184 | parser = argparse.ArgumentParser() 185 | parser.add_argument('--book_ids_path', type=str) 186 | parser.add_argument('--output_directory_path', type=str) 187 | parser.add_argument('--format', type=str, action="store", default="json", 188 | dest="format", choices=["json", "csv"], 189 | help="set file output format") 190 | args = parser.parse_args() 191 | 192 | book_ids = [line.strip() for line in open(args.book_ids_path, 'r') if line.strip()] 193 | books_already_scraped = [file_name.replace('.json', '') for file_name in os.listdir(args.output_directory_path) if file_name.endswith('.json') and not file_name.startswith('all_books')] 194 | books_to_scrape = [book_id for book_id in book_ids if book_id not in books_already_scraped] 195 | condensed_books_path = args.output_directory_path + '/all_books' 196 | 197 | for i, book_id in enumerate(books_to_scrape): 198 | try: 199 | print(str(datetime.now()) + ' ' + script_name + ': Scraping ' + book_id + '...') 200 | print(str(datetime.now()) + ' ' + script_name + ': #' + str(i+1+len(books_already_scraped)) + ' out of ' + str(len(book_ids)) + ' books') 201 | 202 | book = scrape_book(book_id) 203 | json.dump(book, open(args.output_directory_path + '/' + book_id + '.json', 'w')) 204 | 205 | print('=============================') 206 | 207 | except HTTPError as e: 208 | print(e) 209 | exit(0) 210 | 211 | 212 | books = condense_books(args.output_directory_path) 213 | if args.format == 'json': 214 | json.dump(books, open(f"{condensed_books_path}.json", 'w')) 215 | elif args.format == 'csv': 216 | json.dump(books, open(f"{condensed_books_path}.json", 'w')) 217 | book_df = pd.read_json(f"{condensed_books_path}.json") 218 | book_df.to_csv(f"{condensed_books_path}.csv", index=False, encoding='utf-8') 219 | 220 | print(str(datetime.now()) + ' ' + script_name + f':\n\n🎉 Success! All book metadata scraped. 🎉\n\nMetadata files have been output to /{args.output_directory_path}\nGoodreads scraping run time = ⏰ ' + str(datetime.now() - start_time) + ' ⏰') 221 | 222 | 223 | 224 | if __name__ == '__main__': 225 | main() 226 | -------------------------------------------------------------------------------- /get_reviews.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | from collections import Counter 3 | from datetime import datetime 4 | import json 5 | import os 6 | import regex as re 7 | import time 8 | import bs4 9 | from selenium import webdriver 10 | from selenium.webdriver.common.action_chains import ActionChains 11 | from selenium.common.exceptions import NoSuchElementException, ElementNotInteractableException, ElementClickInterceptedException, ElementNotVisibleException, StaleElementReferenceException 12 | from selenium.webdriver.support.ui import Select 13 | from urllib.request import urlopen 14 | from urllib.error import HTTPError 15 | import credentials 16 | from selenium.webdriver.common.by import By 17 | import pandas as pd 18 | from chromedriver_py import binary_path 19 | import geckodriver_autoinstaller 20 | 21 | 22 | RATING_STARS_DICT = {'it was amazing': 5, 23 | 'really liked it': 4, 24 | 'liked it': 3, 25 | 'it was ok': 2, 26 | 'did not like it': 1, 27 | '': None} 28 | 29 | 30 | def switch_reviews_mode(driver, book_id, sort_order, rating=''): 31 | """ 32 | Copyright (C) 2019 by Omar Einea: https://github.com/OmarEinea/GoodReadsScraper 33 | Licensed under GPL v3.0: https://github.com/OmarEinea/GoodReadsScraper/blob/master/LICENSE.md 34 | Accessed on 2019-12-01. 35 | """ 36 | edition_reviews=False 37 | driver.execute_script( 38 | 'document.getElementById("reviews").insertAdjacentHTML("beforeend", \'Switch Mode\');' + 42 | f'document.getElementById("switch{rating}{sort_order}").click()' 43 | ) 44 | return True 45 | 46 | 47 | def get_rating(node): 48 | if len(node.find_all('span', {'class': 'staticStars'})) > 0: 49 | rating = node.find_all('span', {'class': 'staticStars'})[0]['title'] 50 | return RATING_STARS_DICT[rating] 51 | return '' 52 | 53 | 54 | def get_user_name(node): 55 | if len(node.find_all('a', {'class': 'user'})) > 0: 56 | return node.find_all('a', {'class': 'user'})[0]['title'] 57 | return '' 58 | 59 | def get_user_url(node): 60 | if len(node.find_all('a', {'class': 'user'})) > 0: 61 | return node.find_all('a', {'class': 'user'})[0]['href'] 62 | return '' 63 | 64 | 65 | def get_date(node): 66 | if len(node.find_all('a', {'class': 'reviewDate createdAt right'})) > 0: 67 | return node.find_all('a', {'class': 'reviewDate createdAt right'})[0].text 68 | return '' 69 | 70 | 71 | def get_text(node): 72 | 73 | display_text = '' 74 | full_text = '' 75 | 76 | if len(node.find_all('span', {'class': 'readable'})) > 0: 77 | for child in node.find_all('span', {'class': 'readable'})[0].children: 78 | if child.name == 'span' and 'style' not in child: 79 | display_text = child.text 80 | if child.name == 'span' and 'style' in child and child['style'] == 'display:none': 81 | full_text = child.text 82 | 83 | if full_text: 84 | return full_text 85 | 86 | return display_text 87 | 88 | 89 | def get_num_likes(node): 90 | if node.find('span', {'class': 'likesCount'}) and len(node.find('span', {'class': 'likesCount'})) > 0: 91 | likes = node.find('span', {'class': 'likesCount'}).text 92 | if 'likes' in likes: 93 | return int(likes.split()[0]) 94 | return 0 95 | 96 | 97 | def get_shelves(node): 98 | shelves = [] 99 | if node.find('div', {'class': 'uitext greyText bookshelves'}): 100 | _shelves_node = node.find('div', {'class': 'uitext greyText bookshelves'}) 101 | for _shelf_node in _shelves_node.find_all('a'): 102 | shelves.append(_shelf_node.text) 103 | return shelves 104 | 105 | def get_id(bookid): 106 | pattern = re.compile("([^.]+)") 107 | return pattern.search(bookid).group() 108 | 109 | 110 | def scrape_reviews_on_current_page(driver, url, book_id, sort_order): 111 | 112 | reviews = [] 113 | 114 | # Pull the page source, load into BeautifulSoup, and find all review nodes. 115 | source = driver.page_source 116 | soup = bs4.BeautifulSoup(source, 'lxml') 117 | nodes = soup.find_all('div', {'class': 'review'}) 118 | book_title = soup.find(id='bookTitle').text.strip() 119 | 120 | # Iterate through and parse the reviews. 121 | for node in nodes: 122 | review_id = re.search('[0-9]+', node['id']).group(0) 123 | reviews.append({'book_id_title': book_id, 124 | 'book_id': get_id(book_id), 125 | 'book_title': book_title, 126 | 'review_url': f"https://www.goodreads.com/review/show/{review_id}", 127 | 'review_id': review_id, 128 | 'date': get_date(node), 129 | 'rating': get_rating(node), 130 | 'user_name': get_user_name(node), 131 | 'user_url': get_user_url(node), 132 | 'text': get_text(node), 133 | 'num_likes': get_num_likes(node), 134 | 'sort_order': sort_order, 135 | 'shelves': get_shelves(node)}) 136 | 137 | return reviews 138 | 139 | 140 | def check_for_duplicates(reviews): 141 | review_ids = [r['review_id'] for r in reviews] 142 | num_duplicates = len([_id for _id, _count in Counter(review_ids).items() if _count > 1]) 143 | return num_duplicates 144 | 145 | def get_reviews_first_ten_pages(driver, book_id, sort_order): 146 | 147 | reviews = [] 148 | url = 'https://www.goodreads.com/book/show/' + book_id 149 | driver.get(url) 150 | 151 | source = driver.page_source 152 | 153 | try: 154 | time.sleep(4) 155 | # Re-order the reviews so that we scrape the newest or oldest reviews instead of the default. 156 | if sort_order != 'default': 157 | switch_reviews_mode(driver, book_id, sort_order) 158 | time.sleep(2) 159 | 160 | if sort_order == 'newest' or sort_order == 'oldest': 161 | select = Select(driver.find_element_by_name('language_code')) 162 | select.select_by_value('en') 163 | time.sleep(4) 164 | 165 | # Scrape the first page of reviews. 166 | reviews = scrape_reviews_on_current_page(driver, url, book_id, sort_order) 167 | print('Scraped page 1') 168 | # GoodReads will only load the first 10 pages of reviews. 169 | # Click through each of the following nine pages and scrape each page. 170 | page_counter = 2 171 | while page_counter <=10: 172 | try: 173 | if driver.find_element_by_link_text(str(page_counter)): 174 | driver.find_element_by_link_text(str(page_counter)).click() 175 | time.sleep(3) 176 | reviews += scrape_reviews_on_current_page(driver, url, book_id, sort_order) 177 | print(f"Scraped page {page_counter}") 178 | page_counter += 1 179 | else: 180 | return reviews 181 | 182 | except NoSuchElementException: 183 | if page_counter == 10: 184 | try: 185 | driver.find_element_by_link_text(str(9)).click() 186 | time.sleep(2) 187 | continue 188 | except: 189 | return reviews 190 | else: 191 | try: 192 | if driver.find_element(By.CLASS_NAME, 'next_page'): 193 | driver.find_element(By.CLASS_NAME, 'next_page').click() 194 | continue 195 | except NoSuchElementException: 196 | print("'next' button not found either") 197 | return reviews 198 | 199 | except ElementNotVisibleException: 200 | print('ERROR ElementNotVisibleException: Pop-up detected, reloading the page.') 201 | reviews = get_reviews_first_ten_pages(driver, book_id, sort_order) 202 | return reviews 203 | 204 | except ElementClickInterceptedException: 205 | print(f'🚨 ElementClickInterceptedException (Likely a pop-up)🚨\n🔄 Refreshing Goodreads site and skipping problem page {page_counter}🔄') 206 | driver.get(url) 207 | time.sleep(3) 208 | page_counter += 1 209 | continue 210 | 211 | except StaleElementReferenceException: 212 | print('ERROR: StaleElementReferenceException\nRefreshing Goodreads site and skipping problem page {page_counter} ') 213 | driver.get(url) 214 | time.sleep(3) 215 | page_counter += 1 216 | continue 217 | 218 | except ElementClickInterceptedException: 219 | print(f'🚨 ElementClickInterceptedException (Likely a pop-up)🚨\n🔄 Refreshing Goodreads site and rescraping book🔄') 220 | driver.get(url) 221 | time.sleep(3) 222 | reviews = get_reviews_first_ten_pages(driver, book_id, sort_order) 223 | return reviews 224 | 225 | except ElementNotInteractableException: 226 | print('🚨 ElementNotInteractableException🚨 \n🔄 Refreshing Goodreads site and rescraping book🔄') 227 | reviews = get_reviews_first_ten_pages(driver, book_id, sort_order) 228 | return reviews 229 | 230 | 231 | if check_for_duplicates(reviews) >= 30: 232 | print(f'ERROR: {check_for_duplicates(reviews)} duplicates found! Re-scraping this book.') 233 | reviews = get_reviews_first_ten_pages(driver, book_id, sort_order) 234 | return reviews 235 | else: 236 | return reviews 237 | 238 | return reviews 239 | 240 | def condense_reviews(reviews_directory_path): 241 | reviews = [] 242 | for file_name in os.listdir(reviews_directory_path): 243 | if file_name.endswith('.json') and not file_name.startswith('.') and file_name != "all_reviews.json": 244 | _reviews = json.load(open(reviews_directory_path + '/' + file_name, 'r')) 245 | reviews += _reviews 246 | return reviews 247 | 248 | def main(): 249 | 250 | start_time = datetime.now() 251 | script_name = os.path.basename(__file__) 252 | 253 | parser = argparse.ArgumentParser() 254 | parser.add_argument('--book_ids_path', type=str) 255 | parser.add_argument('--output_directory_path', type=str) 256 | parser.add_argument('--browser', type=str) 257 | parser.add_argument('--sort_order', type=str) 258 | parser.add_argument('--format', type=str, action="store", default="json", 259 | dest="format", choices=["json", "csv"], 260 | help="set file output format") 261 | args = parser.parse_args() 262 | 263 | book_ids = [line.strip() for line in open(args.book_ids_path, 'r') if line.strip()] 264 | books_already_scraped = [file_name.replace('.json', '') for file_name in os.listdir(args.output_directory_path) if file_name.endswith('.json') and not file_name.startswith('all_reviews')] 265 | books_to_scrape = [book_id for book_id in book_ids if book_id not in books_already_scraped] 266 | condensed_reviews_path = args.output_directory_path + '/all_reviews' 267 | 268 | 269 | 270 | #Set up driver 271 | 272 | if args.browser.lower() == 'chrome': 273 | driver = webdriver.Chrome(executable_path=binary_path) 274 | #driver = webdriver.Chrome(args.web_driver_path) 275 | elif args.browser.lower() == 'firefox': 276 | geckodriver_autoinstaller.install() 277 | driver = webdriver.Firefox() 278 | else: 279 | print('Please select a web browser: Chrome or Firefox') 280 | 281 | for i, book_id in enumerate(books_to_scrape): 282 | try: 283 | 284 | print(str(datetime.now()) + ' ' + script_name + ': Scraping ' + book_id + '...') 285 | print(str(datetime.now()) + ' ' + script_name + ': #' + str(i+1+len(books_already_scraped)) + ' out of ' + str(len(book_ids)) + ' books') 286 | 287 | reviews = get_reviews_first_ten_pages(driver, book_id, args.sort_order) 288 | 289 | if reviews: 290 | print(str(datetime.now()) + ' ' + script_name + ': Scraped ✨' + str(len(reviews)) + '✨ reviews for ' + book_id) 291 | json.dump(reviews, open(args.output_directory_path + '/' + book_id + '.json', 'w')) 292 | 293 | print('=============================') 294 | 295 | except HTTPError: 296 | pass 297 | 298 | driver.quit() 299 | 300 | reviews = condense_reviews(args.output_directory_path) 301 | if args.format == 'json': 302 | json.dump(reviews, open(f"{condensed_reviews_path}.json", 'w')) 303 | elif args.format == 'csv': 304 | json.dump(reviews, open(f"{condensed_reviews_path}.json", 'w')) 305 | review_df = pd.read_json(f"{condensed_reviews_path}.json") 306 | review_df.to_csv(f"{condensed_reviews_path}.csv", index=False, encoding='utf-8') 307 | 308 | 309 | print(str(datetime.now()) + ' ' + script_name + f':\n\n🎉 Success! All book reviews scraped. 🎉\n\nGoodreads review files have been output to /{args.output_directory_path}\nGoodreads scraping run time = ⏰ ' + str(datetime.now() - start_time) + ' ⏰') 310 | 311 | 312 | if __name__ == '__main__': 313 | main() 314 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . -------------------------------------------------------------------------------- /How-To-Use-Goodreads-Scraper.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# How to Use the Goodreads Scraper" 8 | ] 9 | }, 10 | { 11 | "cell_type": "markdown", 12 | "metadata": {}, 13 | "source": [ 14 | "By [Melanie Walsh](https://melaniewalsh.org/) and [Maria Antoniak](https://maria-antoniak.github.io/)" 15 | ] 16 | }, 17 | { 18 | "cell_type": "markdown", 19 | "metadata": {}, 20 | "source": [ 21 | "This Jupyter notebook will walk you through how to collect Goodreads reviews and Goodreads book metadata (# reviews, # ratings, shelves, etc.) with our [Goodreads Scraper](https://github.com/maria-antoniak/goodreads-scraper) Python scripts.\n", 22 | "\n", 23 | "*Note: We recommend running these Python scripts from the command line. Please note that these scripts may not work consistently from a Jupyter notebook environment and that the tutorial is mostly intended for demonstration purposes.*" 24 | ] 25 | }, 26 | { 27 | "cell_type": "markdown", 28 | "metadata": {}, 29 | "source": [ 30 | "## Download the `goodreads-scraper` GitHub Repository" 31 | ] 32 | }, 33 | { 34 | "cell_type": "markdown", 35 | "metadata": {}, 36 | "source": [ 37 | "First, you need to download the `goodreads-scraper` GitHub repository (which includes this Jupyter notebook). You can either clone the repository with git:" 38 | ] 39 | }, 40 | { 41 | "cell_type": "code", 42 | "execution_count": 1, 43 | "metadata": {}, 44 | "outputs": [ 45 | { 46 | "name": "stdout", 47 | "output_type": "stream", 48 | "text": [ 49 | "Cloning into 'goodreads-scraper'...\n", 50 | "remote: Enumerating objects: 129, done.\u001b[K\n", 51 | "remote: Counting objects: 100% (129/129), done.\u001b[K\n", 52 | "remote: Compressing objects: 100% (105/105), done.\u001b[K\n", 53 | "remote: Total 129 (delta 64), reused 53 (delta 22), pack-reused 0\u001b[K\n", 54 | "Receiving objects: 100% (129/129), 31.45 KiB | 7.86 MiB/s, done.\n", 55 | "Resolving deltas: 100% (64/64), done.\n" 56 | ] 57 | } 58 | ], 59 | "source": [ 60 | "!git clone https://github.com/maria-antoniak/goodreads-scraper.git" 61 | ] 62 | }, 63 | { 64 | "cell_type": "markdown", 65 | "metadata": {}, 66 | "source": [ 67 | "Or you can download the repository as a zip file by clicking the following link: \n", 68 | "https://github.com/maria-antoniak/goodreads-scraper/archive/master.zip" 69 | ] 70 | }, 71 | { 72 | "cell_type": "markdown", 73 | "metadata": {}, 74 | "source": [ 75 | "If you haven't already, move into the `/goodreads-scraper` directory:" 76 | ] 77 | }, 78 | { 79 | "cell_type": "code", 80 | "execution_count": 415, 81 | "metadata": {}, 82 | "outputs": [ 83 | { 84 | "name": "stdout", 85 | "output_type": "stream", 86 | "text": [ 87 | "/Users/melaniewalsh/Goodreads-Project/notebooks/goodreads-scraper\n" 88 | ] 89 | } 90 | ], 91 | "source": [ 92 | "cd goodreads-scraper/" 93 | ] 94 | }, 95 | { 96 | "cell_type": "markdown", 97 | "metadata": {}, 98 | "source": [ 99 | "## Install required Python packages" 100 | ] 101 | }, 102 | { 103 | "cell_type": "code", 104 | "execution_count": 18, 105 | "metadata": {}, 106 | "outputs": [ 107 | { 108 | "name": "stdout", 109 | "output_type": "stream", 110 | "text": [ 111 | "Requirement already satisfied: beautifulsoup4 in /Users/melaniewalsh/opt/anaconda3/lib/python3.7/site-packages (from -r requirements.txt (line 1)) (4.6.0)\n", 112 | "Requirement already satisfied: selenium in /Users/melaniewalsh/opt/anaconda3/lib/python3.7/site-packages (from -r requirements.txt (line 2)) (3.141.0)\n", 113 | "Requirement already satisfied: lxml in /Users/melaniewalsh/opt/anaconda3/lib/python3.7/site-packages (from -r requirements.txt (line 3)) (4.5.2)\n", 114 | "Requirement already satisfied: geckodriver-autoinstaller in /Users/melaniewalsh/opt/anaconda3/lib/python3.7/site-packages (from -r requirements.txt (line 4)) (0.1.0)\n", 115 | "Requirement already satisfied: chromedriver-py in /Users/melaniewalsh/opt/anaconda3/lib/python3.7/site-packages (from -r requirements.txt (line 5)) (86.0.4240.22)\n", 116 | "Requirement already satisfied: urllib3 in /Users/melaniewalsh/opt/anaconda3/lib/python3.7/site-packages (from selenium->-r requirements.txt (line 2)) (1.25.9)\n" 117 | ] 118 | } 119 | ], 120 | "source": [ 121 | "!pip install -r requirements.txt" 122 | ] 123 | }, 124 | { 125 | "cell_type": "markdown", 126 | "metadata": {}, 127 | "source": [ 128 | "## Inspect Goodreads Book ID File" 129 | ] 130 | }, 131 | { 132 | "cell_type": "markdown", 133 | "metadata": {}, 134 | "source": [ 135 | "To collect Goodreads data about particular books, you need to create a plain text file with the books' corresponding Goodreads IDs.\n", 136 | "\n", 137 | "Goodreads IDs can be found at the end of a book's Goodreads URL. For example, the book ID for *Little Women* — https://www.goodreads.com/book/show/1934.Little_Women — is `1934.Little_Women`.\n", 138 | "\n", 139 | "You can inspect the the sample book ID file included in the repository as an example:" 140 | ] 141 | }, 142 | { 143 | "cell_type": "code", 144 | "execution_count": 419, 145 | "metadata": {}, 146 | "outputs": [ 147 | { 148 | "name": "stdout", 149 | "output_type": "stream", 150 | "text": [ 151 | "1885.Pride_and_Prejudice\n", 152 | "2657.To_Kill_a_Mockingbird\n", 153 | "4671.The_Great_Gatsby\n", 154 | "10210.Jane_Eyre\n", 155 | "1371.The_Iliad\n", 156 | "6185.Wuthering_Heights\n", 157 | "5107.The_Catcher_in_the_Rye\n", 158 | "11337.The_Bluest_Eye\n", 159 | "320.One_Hundred_Years_of_Solitude\n", 160 | "36529.Narrative_of_the_Life_of_Frederick_Douglass\n", 161 | "1934.Little_Women\n", 162 | "12296.The_Scarlet_Letter\n", 163 | "18423.The_Left_Hand_of_Darkness\n", 164 | "14942.Mrs_Dalloway\n", 165 | "38447.The_Handmaid_s_Tale" 166 | ] 167 | } 168 | ], 169 | "source": [ 170 | "!cat goodreads_classics_sample.txt" 171 | ] 172 | }, 173 | { 174 | "cell_type": "markdown", 175 | "metadata": {}, 176 | "source": [ 177 | "# Collect Goodreads Book Metadata\n", 178 | "## # ratings, # reviews, average rating, shelves, lists etc." 179 | ] 180 | }, 181 | { 182 | "cell_type": "markdown", 183 | "metadata": {}, 184 | "source": [ 185 | "## Make new directory for book metadata" 186 | ] 187 | }, 188 | { 189 | "cell_type": "markdown", 190 | "metadata": {}, 191 | "source": [ 192 | "Make a new directory to output the book metadata " 193 | ] 194 | }, 195 | { 196 | "cell_type": "code", 197 | "execution_count": 417, 198 | "metadata": {}, 199 | "outputs": [], 200 | "source": [ 201 | "!mkdir classic_book_metadata" 202 | ] 203 | }, 204 | { 205 | "cell_type": "markdown", 206 | "metadata": {}, 207 | "source": [ 208 | "## Run book metadata collection script" 209 | ] 210 | }, 211 | { 212 | "cell_type": "markdown", 213 | "metadata": {}, 214 | "source": [ 215 | "Below we're running the `get_books.py` script and directing it to output files to `/classic_book_metadata`. We're also setting the file format of the aggregated book metadata as a CSV file (in addition to a JSON file)." 216 | ] 217 | }, 218 | { 219 | "cell_type": "code", 220 | "execution_count": 429, 221 | "metadata": {}, 222 | "outputs": [ 223 | { 224 | "name": "stdout", 225 | "output_type": "stream", 226 | "text": [ 227 | "2020-10-15 12:26:16.651934 get_books.py: Scraping 1885.Pride_and_Prejudice...\n", 228 | "2020-10-15 12:26:16.651985 get_books.py: #1 out of 15 books\n", 229 | "=============================\n", 230 | "2020-10-15 12:27:07.449440 get_books.py: Scraping 2657.To_Kill_a_Mockingbird...\n", 231 | "2020-10-15 12:27:07.449466 get_books.py: #2 out of 15 books\n", 232 | "=============================\n", 233 | "2020-10-15 12:27:56.722658 get_books.py: Scraping 4671.The_Great_Gatsby...\n", 234 | "2020-10-15 12:27:56.722674 get_books.py: #3 out of 15 books\n", 235 | "=============================\n", 236 | "2020-10-15 12:28:49.392396 get_books.py: Scraping 10210.Jane_Eyre...\n", 237 | "2020-10-15 12:28:49.392417 get_books.py: #4 out of 15 books\n", 238 | "=============================\n", 239 | "2020-10-15 12:29:38.987517 get_books.py: Scraping 1371.The_Iliad...\n", 240 | "2020-10-15 12:29:38.987533 get_books.py: #5 out of 15 books\n", 241 | "=============================\n", 242 | "2020-10-15 12:30:29.021774 get_books.py: Scraping 6185.Wuthering_Heights...\n", 243 | "2020-10-15 12:30:29.021790 get_books.py: #6 out of 15 books\n", 244 | "=============================\n", 245 | "2020-10-15 12:31:17.578016 get_books.py: Scraping 5107.The_Catcher_in_the_Rye...\n", 246 | "2020-10-15 12:31:17.578033 get_books.py: #7 out of 15 books\n", 247 | "=============================\n", 248 | "2020-10-15 12:32:06.722567 get_books.py: Scraping 11337.The_Bluest_Eye...\n", 249 | "2020-10-15 12:32:06.722586 get_books.py: #8 out of 15 books\n", 250 | "=============================\n", 251 | "2020-10-15 12:32:55.962465 get_books.py: Scraping 320.One_Hundred_Years_of_Solitude...\n", 252 | "2020-10-15 12:32:55.962481 get_books.py: #9 out of 15 books\n", 253 | "=============================\n", 254 | "2020-10-15 12:33:47.293910 get_books.py: Scraping 36529.Narrative_of_the_Life_of_Frederick_Douglass...\n", 255 | "2020-10-15 12:33:47.293925 get_books.py: #10 out of 15 books\n", 256 | "=============================\n", 257 | "2020-10-15 12:34:26.864034 get_books.py: Scraping 1934.Little_Women...\n", 258 | "2020-10-15 12:34:26.864057 get_books.py: #11 out of 15 books\n", 259 | "=============================\n", 260 | "2020-10-15 12:35:17.065387 get_books.py: Scraping 12296.The_Scarlet_Letter...\n", 261 | "2020-10-15 12:35:17.065412 get_books.py: #12 out of 15 books\n", 262 | "=============================\n", 263 | "2020-10-15 12:36:05.814597 get_books.py: Scraping 18423.The_Left_Hand_of_Darkness...\n", 264 | "2020-10-15 12:36:05.814614 get_books.py: #13 out of 15 books\n", 265 | "=============================\n", 266 | "2020-10-15 12:36:57.055810 get_books.py: Scraping 14942.Mrs_Dalloway...\n", 267 | "2020-10-15 12:36:57.055825 get_books.py: #14 out of 15 books\n", 268 | "=============================\n", 269 | "2020-10-15 12:37:47.932972 get_books.py: Scraping 38447.The_Handmaid_s_Tale...\n", 270 | "2020-10-15 12:37:47.932992 get_books.py: #15 out of 15 books\n", 271 | "=============================\n", 272 | "2020-10-15 12:38:37.224221 get_books.py:\n", 273 | "\n", 274 | "🎉 Success! All book metadata scraped. 🎉\n", 275 | "\n", 276 | "Metadata files have been output to /classic_book_metadata\n", 277 | "Goodreads scraping run time = ⏰ 0:12:20.573623 ⏰\n" 278 | ] 279 | } 280 | ], 281 | "source": [ 282 | "!python get_books.py --book_ids_path goodreads_classics_sample.txt --output_directory_path classic_book_metadata --format csv" 283 | ] 284 | }, 285 | { 286 | "cell_type": "markdown", 287 | "metadata": {}, 288 | "source": [ 289 | "Let's import Pandas so we can read in the aggregated CSV and see what the data looks like:" 290 | ] 291 | }, 292 | { 293 | "cell_type": "code", 294 | "execution_count": 4, 295 | "metadata": {}, 296 | "outputs": [], 297 | "source": [ 298 | "import pandas as pd" 299 | ] 300 | }, 301 | { 302 | "cell_type": "code", 303 | "execution_count": 5, 304 | "metadata": { 305 | "scrolled": true 306 | }, 307 | "outputs": [ 308 | { 309 | "data": { 310 | "text/html": [ 311 | "
\n", 312 | "\n", 325 | "\n", 326 | " \n", 327 | " \n", 328 | " \n", 329 | " \n", 330 | " \n", 331 | " \n", 332 | " \n", 333 | " \n", 334 | " \n", 335 | " \n", 336 | " \n", 337 | " \n", 338 | " \n", 339 | " \n", 340 | " \n", 341 | " \n", 342 | " \n", 343 | " \n", 344 | " \n", 345 | " \n", 346 | " \n", 347 | " \n", 348 | " \n", 349 | " \n", 350 | " \n", 351 | " \n", 352 | " \n", 353 | " \n", 354 | " \n", 355 | " \n", 356 | " \n", 357 | " \n", 358 | " \n", 359 | " \n", 360 | " \n", 361 | " \n", 362 | " \n", 363 | " \n", 364 | " \n", 365 | " \n", 366 | " \n", 367 | " \n", 368 | " \n", 369 | " \n", 370 | " \n", 371 | " \n", 372 | " \n", 373 | " \n", 374 | " \n", 375 | " \n", 376 | " \n", 377 | " \n", 378 | " \n", 379 | " \n", 380 | " \n", 381 | " \n", 382 | " \n", 383 | " \n", 384 | " \n", 385 | " \n", 386 | " \n", 387 | " \n", 388 | " \n", 389 | " \n", 390 | " \n", 391 | " \n", 392 | " \n", 393 | " \n", 394 | " \n", 395 | " \n", 396 | " \n", 397 | " \n", 398 | " \n", 399 | " \n", 400 | " \n", 401 | " \n", 402 | " \n", 403 | " \n", 404 | " \n", 405 | " \n", 406 | " \n", 407 | " \n", 408 | " \n", 409 | " \n", 410 | " \n", 411 | " \n", 412 | " \n", 413 | " \n", 414 | " \n", 415 | " \n", 416 | " \n", 417 | " \n", 418 | " \n", 419 | " \n", 420 | " \n", 421 | " \n", 422 | " \n", 423 | " \n", 424 | " \n", 425 | " \n", 426 | " \n", 427 | " \n", 428 | " \n", 429 | " \n", 430 | " \n", 431 | " \n", 432 | " \n", 433 | " \n", 434 | " \n", 435 | " \n", 436 | " \n", 437 | " \n", 438 | " \n", 439 | " \n", 440 | " \n", 441 | " \n", 442 | " \n", 443 | " \n", 444 | " \n", 445 | " \n", 446 | " \n", 447 | " \n", 448 | " \n", 449 | " \n", 450 | " \n", 451 | " \n", 452 | " \n", 453 | " \n", 454 | " \n", 455 | " \n", 456 | " \n", 457 | " \n", 458 | " \n", 459 | " \n", 460 | " \n", 461 | " \n", 462 | " \n", 463 | " \n", 464 | " \n", 465 | " \n", 466 | " \n", 467 | " \n", 468 | " \n", 469 | " \n", 470 | " \n", 471 | " \n", 472 | " \n", 473 | " \n", 474 | " \n", 475 | " \n", 476 | " \n", 477 | " \n", 478 | " \n", 479 | " \n", 480 | " \n", 481 | " \n", 482 | " \n", 483 | " \n", 484 | " \n", 485 | " \n", 486 | " \n", 487 | " \n", 488 | " \n", 489 | " \n", 490 | " \n", 491 | " \n", 492 | " \n", 493 | " \n", 494 | " \n", 495 | " \n", 496 | " \n", 497 | " \n", 498 | " \n", 499 | " \n", 500 | " \n", 501 | " \n", 502 | " \n", 503 | " \n", 504 | " \n", 505 | " \n", 506 | " \n", 507 | " \n", 508 | " \n", 509 | " \n", 510 | " \n", 511 | " \n", 512 | " \n", 513 | " \n", 514 | " \n", 515 | " \n", 516 | " \n", 517 | " \n", 518 | " \n", 519 | " \n", 520 | " \n", 521 | " \n", 522 | " \n", 523 | " \n", 524 | " \n", 525 | " \n", 526 | " \n", 527 | " \n", 528 | " \n", 529 | " \n", 530 | " \n", 531 | " \n", 532 | " \n", 533 | " \n", 534 | " \n", 535 | " \n", 536 | " \n", 537 | " \n", 538 | " \n", 539 | " \n", 540 | " \n", 541 | " \n", 542 | " \n", 543 | " \n", 544 | " \n", 545 | " \n", 546 | " \n", 547 | " \n", 548 | " \n", 549 | " \n", 550 | " \n", 551 | " \n", 552 | " \n", 553 | " \n", 554 | " \n", 555 | " \n", 556 | " \n", 557 | " \n", 558 | " \n", 559 | " \n", 560 | " \n", 561 | " \n", 562 | " \n", 563 | " \n", 564 | " \n", 565 | " \n", 566 | " \n", 567 | " \n", 568 | " \n", 569 | " \n", 570 | " \n", 571 | " \n", 572 | " \n", 573 | " \n", 574 | " \n", 575 | " \n", 576 | " \n", 577 | " \n", 578 | " \n", 579 | " \n", 580 | " \n", 581 | " \n", 582 | " \n", 583 | " \n", 584 | " \n", 585 | " \n", 586 | " \n", 587 | " \n", 588 | " \n", 589 | " \n", 590 | " \n", 591 | " \n", 592 | " \n", 593 | " \n", 594 | " \n", 595 | " \n", 596 | " \n", 597 | " \n", 598 | " \n", 599 | " \n", 600 | " \n", 601 | " \n", 602 | " \n", 603 | " \n", 604 | " \n", 605 | " \n", 606 | " \n", 607 | " \n", 608 | " \n", 609 | " \n", 610 | " \n", 611 | " \n", 612 | " \n", 613 | " \n", 614 | " \n", 615 | " \n", 616 | " \n", 617 | " \n", 618 | "
book_id_titlebook_idbook_titleisbnisbn13year_first_publishedauthornum_pagesgenresshelveslistsnum_ratingsnum_reviewsaverage_ratingrating_distribution
0320.One_Hundred_Years_of_Solitude320One Hundred Years of Solitude842047183697884204718391967Gabriel García Márquez417['Fiction', 'Classics', 'Magical Realism', 'Li...{'to-read': 660690, 'currently-reading': 34629...{'Best': 80020, 'Books': 7, 'Favorite': 184, '...751336306154.08{'5 Stars': 360307, '4 Stars': 201622, '3 Star...
14671.The_Great_Gatsby4671The Great Gatsby068480152397806848015201925F. Scott Fitzgerald200['Classics', 'Fiction', 'Academic > School', '...{'to-read': 1065506, 'classics': 43826, 'curre...{'Books': 34, 'Best': 111, '100': 26, '1001': ...3765257670353.92{'5 Stars': 1341705, '4 Stars': 1263237, '3 St...
238447.The_Handmaid_s_Tale38447The Handmaid's Taleisbn not foundisbn13 not found1985Margaret Atwood314['Fiction', 'Classics', 'Science Fiction > Dys...{'to-read': 847109, 'currently-reading': 13201...{'Best': 71, 'Books': 3429, '100': 71, 'The': ...1453397705414.11{'5 Stars': 614053, '4 Stars': 515080, '3 Star...
31885.Pride_and_Prejudice1885Pride and Prejudice055321310597805532131021813Jane Austen279['Classics', 'Fiction', 'Romance', 'Historical...{'to-read': 1227780, 'currently-reading': 1358...{'Best': 82, 'Books': 229, 'All': 285, '100': ...2988238670874.26{'5 Stars': 1611736, '4 Stars': 814196, '3 Sta...
418423.The_Left_Hand_of_Darkness18423The Left Hand of Darkness044147812397804414781251969Ursula K. Le Guin304['Science Fiction', 'Fiction', 'Fantasy', 'Cla...{'to-read': 116814, 'currently-reading': 8036,...{'Best': 6, 'Science': 3, 'Favorite': 41, '100...11964291314.07{'5 Stars': 46515, '4 Stars': 44532, '3 Stars'...
514942.Mrs_Dalloway14942Mrs. Dalloway015662870897801566287091925Virginia Woolf194['Classics', 'Fiction', 'Literature', 'Novels'...{'to-read': 197554, 'currently-reading': 14288...{'Best': 5, 'The': 19, 'Books': 5, '1001': 528...22269299123.79{'5 Stars': 69055, '4 Stars': 73711, '3 Stars'...
636529.Narrative_of_the_Life_of_Frederick_Douglass36529Narrative of the Life of Frederick Douglass048628499997804862849961845Frederick Douglass158['Nonfiction', 'History', 'Classics', 'Biograp...{'to-read': 89227, 'currently-reading': 4205, ...{'Books': 299, 'Best': 76, '100': 10275, 'Blac...9398643774.04{'5 Stars': 38536, '4 Stars': 30871, '3 Stars'...
712296.The_Scarlet_Letter12296The Scarlet Letter067978338597806797833811850Nathaniel Hawthorne279['Classics', 'Fiction', 'Historical > Historic...{'to-read': 275850, 'classics': 19898, 'curren...{'Books': 50, 'Best': 193, '100': 53, 'The': 1...704758148223.41{'5 Stars': 130486, '4 Stars': 209958, '3 Star...
82657.To_Kill_a_Mockingbird2657To Kill a Mockingbird143955041797814395504101960Harper Lee324['Classics', 'Fiction', 'Historical > Historic...{'to-read': 13346, 'currently-reading': 60856,...{'Books': 338, 'Best': 53, '100': 162, '1001':...4487646911264.28{'5 Stars': 2356364, '4 Stars': 1329450, '3 St...
91371.The_Iliad1371The Iliad04713775899780471377580750Homer683['Classics', 'Poetry', 'Fiction', 'Fantasy > M...{'to-read': 1224, 'currently-reading': 16098, ...{'Books': 28, 'The': 2, 'Big': 7332, 'Best': 2...35110272093.87{'5 Stars': 117275, '4 Stars': 114644, '3 Star...
1010210.Jane_Eyre10210Jane Eyre155111180297815511118031847Charlotte Brontë532['Classics', 'Fiction', 'Romance', 'Historical...{'to-read': 726189, 'currently-reading': 52444...{'Best': 193, 'Books': 131, '100': 1522, 'Big'...1620275421524.13{'5 Stars': 743818, '4 Stars': 500212, '3 Star...
1111337.The_Bluest_Eye11337The Bluest Eye030727844197803072784491970Toni Morrison216['Fiction', 'Classics', 'Historical > Historic...{'to-read': 122475, 'currently-reading': 7043,...{'Best': 2, 'Books': 40, \"Oprah's\": 9, 'Most':...17255790894.06{'5 Stars': 65916, '4 Stars': 64896, '3 Stars'...
125107.The_Catcher_in_the_Rye5107The Catcher in the Rye031676948797803167694881951J.D. Salinger277['Classics', 'Fiction', 'Young Adult', 'Litera...{'to-read': 906715, 'classics': 31330, 'curren...{'Books': 7365, 'Best': 1193, '100': 1952, '10...2729479573553.81{'5 Stars': 934635, '4 Stars': 843907, '3 Star...
136185.Wuthering_Heights6185Wuthering Heights055321258397805532125871847Emily Brontë464['Classics', 'Fiction', 'Romance', 'Gothic', '...{'to-read': 660990, 'currently-reading': 53160...{'Best': 1324, 'Books': 19, 'What': 169, '100'...1338683371193.86{'5 Stars': 481611, '4 Stars': 411836, '3 Star...
141934.Little_Women1934Little Women051721462897805172146261868Louisa May Alcott449['Classics', 'Fiction', 'Historical > Historic...{'to-read': 670541, 'currently-reading': 69094...{'Books': 122, 'Best': 42, '100': 1522, 'Favor...1677066308744.09{'5 Stars': 719003, '4 Stars': 539909, '3 Star...
\n", 619 | "
" 620 | ], 621 | "text/plain": [ 622 | " book_id_title book_id \\\n", 623 | "0 320.One_Hundred_Years_of_Solitude 320 \n", 624 | "1 4671.The_Great_Gatsby 4671 \n", 625 | "2 38447.The_Handmaid_s_Tale 38447 \n", 626 | "3 1885.Pride_and_Prejudice 1885 \n", 627 | "4 18423.The_Left_Hand_of_Darkness 18423 \n", 628 | "5 14942.Mrs_Dalloway 14942 \n", 629 | "6 36529.Narrative_of_the_Life_of_Frederick_Douglass 36529 \n", 630 | "7 12296.The_Scarlet_Letter 12296 \n", 631 | "8 2657.To_Kill_a_Mockingbird 2657 \n", 632 | "9 1371.The_Iliad 1371 \n", 633 | "10 10210.Jane_Eyre 10210 \n", 634 | "11 11337.The_Bluest_Eye 11337 \n", 635 | "12 5107.The_Catcher_in_the_Rye 5107 \n", 636 | "13 6185.Wuthering_Heights 6185 \n", 637 | "14 1934.Little_Women 1934 \n", 638 | "\n", 639 | " book_title isbn \\\n", 640 | "0 One Hundred Years of Solitude 8420471836 \n", 641 | "1 The Great Gatsby 0684801523 \n", 642 | "2 The Handmaid's Tale isbn not found \n", 643 | "3 Pride and Prejudice 0553213105 \n", 644 | "4 The Left Hand of Darkness 0441478123 \n", 645 | "5 Mrs. Dalloway 0156628708 \n", 646 | "6 Narrative of the Life of Frederick Douglass 0486284999 \n", 647 | "7 The Scarlet Letter 0679783385 \n", 648 | "8 To Kill a Mockingbird 1439550417 \n", 649 | "9 The Iliad 0471377589 \n", 650 | "10 Jane Eyre 1551111802 \n", 651 | "11 The Bluest Eye 0307278441 \n", 652 | "12 The Catcher in the Rye 0316769487 \n", 653 | "13 Wuthering Heights 0553212583 \n", 654 | "14 Little Women 0517214628 \n", 655 | "\n", 656 | " isbn13 year_first_published author num_pages \\\n", 657 | "0 9788420471839 1967 Gabriel García Márquez 417 \n", 658 | "1 9780684801520 1925 F. Scott Fitzgerald 200 \n", 659 | "2 isbn13 not found 1985 Margaret Atwood 314 \n", 660 | "3 9780553213102 1813 Jane Austen 279 \n", 661 | "4 9780441478125 1969 Ursula K. Le Guin 304 \n", 662 | "5 9780156628709 1925 Virginia Woolf 194 \n", 663 | "6 9780486284996 1845 Frederick Douglass 158 \n", 664 | "7 9780679783381 1850 Nathaniel Hawthorne 279 \n", 665 | "8 9781439550410 1960 Harper Lee 324 \n", 666 | "9 9780471377580 750 Homer 683 \n", 667 | "10 9781551111803 1847 Charlotte Brontë 532 \n", 668 | "11 9780307278449 1970 Toni Morrison 216 \n", 669 | "12 9780316769488 1951 J.D. Salinger 277 \n", 670 | "13 9780553212587 1847 Emily Brontë 464 \n", 671 | "14 9780517214626 1868 Louisa May Alcott 449 \n", 672 | "\n", 673 | " genres \\\n", 674 | "0 ['Fiction', 'Classics', 'Magical Realism', 'Li... \n", 675 | "1 ['Classics', 'Fiction', 'Academic > School', '... \n", 676 | "2 ['Fiction', 'Classics', 'Science Fiction > Dys... \n", 677 | "3 ['Classics', 'Fiction', 'Romance', 'Historical... \n", 678 | "4 ['Science Fiction', 'Fiction', 'Fantasy', 'Cla... \n", 679 | "5 ['Classics', 'Fiction', 'Literature', 'Novels'... \n", 680 | "6 ['Nonfiction', 'History', 'Classics', 'Biograp... \n", 681 | "7 ['Classics', 'Fiction', 'Historical > Historic... \n", 682 | "8 ['Classics', 'Fiction', 'Historical > Historic... \n", 683 | "9 ['Classics', 'Poetry', 'Fiction', 'Fantasy > M... \n", 684 | "10 ['Classics', 'Fiction', 'Romance', 'Historical... \n", 685 | "11 ['Fiction', 'Classics', 'Historical > Historic... \n", 686 | "12 ['Classics', 'Fiction', 'Young Adult', 'Litera... \n", 687 | "13 ['Classics', 'Fiction', 'Romance', 'Gothic', '... \n", 688 | "14 ['Classics', 'Fiction', 'Historical > Historic... \n", 689 | "\n", 690 | " shelves \\\n", 691 | "0 {'to-read': 660690, 'currently-reading': 34629... \n", 692 | "1 {'to-read': 1065506, 'classics': 43826, 'curre... \n", 693 | "2 {'to-read': 847109, 'currently-reading': 13201... \n", 694 | "3 {'to-read': 1227780, 'currently-reading': 1358... \n", 695 | "4 {'to-read': 116814, 'currently-reading': 8036,... \n", 696 | "5 {'to-read': 197554, 'currently-reading': 14288... \n", 697 | "6 {'to-read': 89227, 'currently-reading': 4205, ... \n", 698 | "7 {'to-read': 275850, 'classics': 19898, 'curren... \n", 699 | "8 {'to-read': 13346, 'currently-reading': 60856,... \n", 700 | "9 {'to-read': 1224, 'currently-reading': 16098, ... \n", 701 | "10 {'to-read': 726189, 'currently-reading': 52444... \n", 702 | "11 {'to-read': 122475, 'currently-reading': 7043,... \n", 703 | "12 {'to-read': 906715, 'classics': 31330, 'curren... \n", 704 | "13 {'to-read': 660990, 'currently-reading': 53160... \n", 705 | "14 {'to-read': 670541, 'currently-reading': 69094... \n", 706 | "\n", 707 | " lists num_ratings \\\n", 708 | "0 {'Best': 80020, 'Books': 7, 'Favorite': 184, '... 751336 \n", 709 | "1 {'Books': 34, 'Best': 111, '100': 26, '1001': ... 3765257 \n", 710 | "2 {'Best': 71, 'Books': 3429, '100': 71, 'The': ... 1453397 \n", 711 | "3 {'Best': 82, 'Books': 229, 'All': 285, '100': ... 2988238 \n", 712 | "4 {'Best': 6, 'Science': 3, 'Favorite': 41, '100... 119642 \n", 713 | "5 {'Best': 5, 'The': 19, 'Books': 5, '1001': 528... 222692 \n", 714 | "6 {'Books': 299, 'Best': 76, '100': 10275, 'Blac... 93986 \n", 715 | "7 {'Books': 50, 'Best': 193, '100': 53, 'The': 1... 704758 \n", 716 | "8 {'Books': 338, 'Best': 53, '100': 162, '1001':... 4487646 \n", 717 | "9 {'Books': 28, 'The': 2, 'Big': 7332, 'Best': 2... 351102 \n", 718 | "10 {'Best': 193, 'Books': 131, '100': 1522, 'Big'... 1620275 \n", 719 | "11 {'Best': 2, 'Books': 40, \"Oprah's\": 9, 'Most':... 172557 \n", 720 | "12 {'Books': 7365, 'Best': 1193, '100': 1952, '10... 2729479 \n", 721 | "13 {'Best': 1324, 'Books': 19, 'What': 169, '100'... 1338683 \n", 722 | "14 {'Books': 122, 'Best': 42, '100': 1522, 'Favor... 1677066 \n", 723 | "\n", 724 | " num_reviews average_rating \\\n", 725 | "0 30615 4.08 \n", 726 | "1 67035 3.92 \n", 727 | "2 70541 4.11 \n", 728 | "3 67087 4.26 \n", 729 | "4 9131 4.07 \n", 730 | "5 9912 3.79 \n", 731 | "6 4377 4.04 \n", 732 | "7 14822 3.41 \n", 733 | "8 91126 4.28 \n", 734 | "9 7209 3.87 \n", 735 | "10 42152 4.13 \n", 736 | "11 9089 4.06 \n", 737 | "12 57355 3.81 \n", 738 | "13 37119 3.86 \n", 739 | "14 30874 4.09 \n", 740 | "\n", 741 | " rating_distribution \n", 742 | "0 {'5 Stars': 360307, '4 Stars': 201622, '3 Star... \n", 743 | "1 {'5 Stars': 1341705, '4 Stars': 1263237, '3 St... \n", 744 | "2 {'5 Stars': 614053, '4 Stars': 515080, '3 Star... \n", 745 | "3 {'5 Stars': 1611736, '4 Stars': 814196, '3 Sta... \n", 746 | "4 {'5 Stars': 46515, '4 Stars': 44532, '3 Stars'... \n", 747 | "5 {'5 Stars': 69055, '4 Stars': 73711, '3 Stars'... \n", 748 | "6 {'5 Stars': 38536, '4 Stars': 30871, '3 Stars'... \n", 749 | "7 {'5 Stars': 130486, '4 Stars': 209958, '3 Star... \n", 750 | "8 {'5 Stars': 2356364, '4 Stars': 1329450, '3 St... \n", 751 | "9 {'5 Stars': 117275, '4 Stars': 114644, '3 Star... \n", 752 | "10 {'5 Stars': 743818, '4 Stars': 500212, '3 Star... \n", 753 | "11 {'5 Stars': 65916, '4 Stars': 64896, '3 Stars'... \n", 754 | "12 {'5 Stars': 934635, '4 Stars': 843907, '3 Star... \n", 755 | "13 {'5 Stars': 481611, '4 Stars': 411836, '3 Star... \n", 756 | "14 {'5 Stars': 719003, '4 Stars': 539909, '3 Star... " 757 | ] 758 | }, 759 | "execution_count": 5, 760 | "metadata": {}, 761 | "output_type": "execute_result" 762 | } 763 | ], 764 | "source": [ 765 | "metadata = pd.read_csv(\"classic_book_metadata/all_books.csv\")\n", 766 | "metadata" 767 | ] 768 | }, 769 | { 770 | "cell_type": "markdown", 771 | "metadata": {}, 772 | "source": [ 773 | "Let's plot the total number of Goodreads ratings for each book" 774 | ] 775 | }, 776 | { 777 | "cell_type": "code", 778 | "execution_count": 11, 779 | "metadata": {}, 780 | "outputs": [ 781 | { 782 | "data": { 783 | "text/plain": [ 784 | "" 785 | ] 786 | }, 787 | "execution_count": 11, 788 | "metadata": {}, 789 | "output_type": "execute_result" 790 | }, 791 | { 792 | "data": { 793 | "image/png": "iVBORw0KGgoAAAANSUhEUgAAAkUAAAEFCAYAAADtzpMwAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAgAElEQVR4nOzde5yWVb3//9dbVA6CZGpGtHPU8MRBiFGT1DDd7u0uzyIVbsNKv+ZW08IiNUPblaVFmYqiIdo2NS1LxdTE8yFlOINm/tSxRCu1wPAMfn5/rHXj5e0999z3HBgG3s/HYx5zXeta11rruhmYxVrrWh9FBGZmZmbruvW6ugFmZmZmawJ3iszMzMxwp8jMzMwMcKfIzMzMDHCnyMzMzAyA9bu6AWbWdptttlk0NDR0dTPMzLqV2bNnvxARm5enu1Nk1o01NDTQ1NTU1c0wM+tWJD1dKd3TZ2ZmZma4U2RmZmYGePrMCiRtCszMp+8HVgLP5/NdIuKNFu6bDtwUEddJem8u4zzgVuC8iDhM0mhgQkR8StJ4oDEijm9DGxuAp4D/jYhv5rTNgOeAi+stM5d3U0QMKUtvBI6MiBPrbWO+/y7S8zaVpR8A7BgRZ9dQxvKI6Fstz8Ily2iYOKMtTTQz67aaz/5kp5TrTpGtEhEvAsMBJE0ClkfEubXeL6k/qSM0NS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q6++yujRoyn9Z+qFF16goaEBgOnTp3PQQQex//77s9VWW3H++efzox/9iBEjRvDRj36Uf/zjHy3WNXr0aE499VQ+/vGP85Of/IQbb7yRXXfdlREjRrDPPvvwt7/9jebmZi666CImT57M8OHDuffee5k0aRLnnnvuqjK+/vWvs8suu7Dtttty771pUuKVV17h8MMPZ9iwYYwdO5Zdd92VpqYmVq5cyfjx4xkyZAhDhw5l8uTJ7f7MPH1mZma2lnr88ce56qqruOSSSzj88MP51a9+VTX/okWLmDt3Lq+99hof/vCH+f73v8/cuXM5+eSTueKKKzjppJNavHfp0qXcfffdAPzzn//kD3/4A5K49NJL+cEPfsAPf/hDjj322HeMFM2cOfMdZaxYsYKHH36Ym2++mTPPPJPbb7+dCy+8kE022YQFCxawaNEihg9P7xXNmzePJUuWsGjRolX1t5c7RWZmZmuprbbaalUnYuTIkTQ3N1fNv9dee9GvXz/69etH//792X///QEYOnQoCxYsqHrv2LFjVx0/88wzjB07lueee4433nij5s0TDznkkHe19b777uPLX/4yAEOGDGHYsLTd3dZbb82TTz7JCSecwCc/+Un23XffmuqoxtNnZmZma6mePd/etq5Hjx6r1vu89dZbAO/a2LCYf7311lt1vt5667FiRfXdQTbaaKNVxyeccALHH388Cxcu5OKLL655A8VSfaW2QtqZupJNNtmE+fPnM3r0aC644AK++MUv1lRHNR4pMjMz62Rr0sLohoYGZs+ezS677MJ1113XKXUsW7aMgQMHAnD55ZevSu/Xrx8vvfRSXWXtvvvu/PKXv2SvvfbikUceYeHChUBaD7Xhhhty6KGHss022zB+/Ph2t7tTR4okhaQfFs4n5OCinVFXg6TPFs4bJZ3XGXUV6rhK0gJJJ5elHyRpx8J5u6LGS1peIe1YSUfm4+1ziI25OQ5am0naQ9LiXF7vsmsri+E88l4/baljkqS6Xj2QdICkiVWuN0ha1EoZDZJezZ/To5IelvS5etpRK0nTJR3WGWUXLVyyjIaJMyp+mZlVMmHCBKZMmcKoUaN44YUXOqWOSZMmMWbMGPbYYw8222yzVen7778/119//a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 795 | "
" 796 | ] 797 | }, 798 | "metadata": { 799 | "needs_background": "light" 800 | }, 801 | "output_type": "display_data" 802 | } 803 | ], 804 | "source": [ 805 | "metadata.sort_values(by='num_ratings').plot(x='book_title', y='num_ratings', kind='barh')" 806 | ] 807 | }, 808 | { 809 | "cell_type": "markdown", 810 | "metadata": {}, 811 | "source": [ 812 | "# Collect Goodreads Reviews (Chrome)\n", 813 | "## full text of review, shelves, date, user name, # likes, etc." 814 | ] 815 | }, 816 | { 817 | "cell_type": "markdown", 818 | "metadata": {}, 819 | "source": [ 820 | "## Make new directory for book reviews" 821 | ] 822 | }, 823 | { 824 | "cell_type": "code", 825 | "execution_count": 13, 826 | "metadata": {}, 827 | "outputs": [], 828 | "source": [ 829 | "!mkdir classic_book_reviews" 830 | ] 831 | }, 832 | { 833 | "cell_type": "markdown", 834 | "metadata": {}, 835 | "source": [ 836 | "## Run Goodreads reviews collection script" 837 | ] 838 | }, 839 | { 840 | "cell_type": "markdown", 841 | "metadata": {}, 842 | "source": [ 843 | "Below we're running `get_reviews.py`, setting `--sort_order` to `default` to collect the most liked and most commented on Goodreads reviews, and indicating that the web browser we'd like to use is Chrome." 844 | ] 845 | }, 846 | { 847 | "cell_type": "code", 848 | "execution_count": 19, 849 | "metadata": { 850 | "scrolled": true 851 | }, 852 | "outputs": [ 853 | { 854 | "name": "stdout", 855 | "output_type": "stream", 856 | "text": [ 857 | "2020-10-16 15:46:36.115814 get_reviews.py: Scraping 1885.Pride_and_Prejudice...\n", 858 | "2020-10-16 15:46:36.116074 get_reviews.py: #1 out of 15 books\n", 859 | "Scraped page 1\n", 860 | "Scraped page 2\n", 861 | "Scraped page 3\n", 862 | "Scraped page 4\n", 863 | "Scraped page 5\n", 864 | "Scraped page 6\n", 865 | "Scraped page 7\n", 866 | "Scraped page 8\n", 867 | "Scraped page 9\n", 868 | "Scraped page 10\n", 869 | "ERROR: 30 duplicates found! Re-scraping this book.\n", 870 | "Scraped page 1\n", 871 | "🚨 ElementClickInterceptedException (Likely a pop-up)🚨\n", 872 | "🔄 Refreshing Goodreads site and skipping problem page 2🔄\n", 873 | "Scraped page 3\n", 874 | "Scraped page 4\n", 875 | "Scraped page 5\n", 876 | "Scraped page 6\n", 877 | "Scraped page 7\n", 878 | "Scraped page 8\n", 879 | "Scraped page 9\n", 880 | "Scraped page 10\n", 881 | "ERROR: 30 duplicates found! Re-scraping this book.\n", 882 | "Scraped page 1\n", 883 | "Scraped page 2\n", 884 | "Scraped page 3\n", 885 | "Scraped page 4\n", 886 | "Scraped page 5\n", 887 | "Scraped page 6\n", 888 | "Scraped page 7\n", 889 | "Scraped page 8\n", 890 | "Scraped page 9\n", 891 | "Scraped page 10\n", 892 | "ERROR: 30 duplicates found! Re-scraping this book.\n", 893 | "Scraped page 1\n", 894 | "Scraped page 2\n", 895 | "Scraped page 3\n", 896 | "Scraped page 4\n", 897 | "Scraped page 5\n", 898 | "Scraped page 6\n", 899 | "Scraped page 7\n", 900 | "Scraped page 8\n", 901 | "Scraped page 9\n", 902 | "Scraped page 10\n", 903 | "2020-10-16 15:49:28.676599 get_reviews.py: Scraped ✨300✨ reviews for 1885.Pride_and_Prejudice\n", 904 | "=============================\n", 905 | "2020-10-16 15:49:28.691914 get_reviews.py: Scraping 2657.To_Kill_a_Mockingbird...\n", 906 | "2020-10-16 15:49:28.691930 get_reviews.py: #2 out of 15 books\n", 907 | "Scraped page 1\n", 908 | "Scraped page 2\n", 909 | "Scraped page 3\n", 910 | "Scraped page 4\n", 911 | "Scraped page 5\n", 912 | "Scraped page 6\n", 913 | "Scraped page 7\n", 914 | "Scraped page 8\n", 915 | "Scraped page 9\n", 916 | "Scraped page 10\n", 917 | "2020-10-16 15:50:14.939548 get_reviews.py: Scraped ✨300✨ reviews for 2657.To_Kill_a_Mockingbird\n", 918 | "=============================\n", 919 | "2020-10-16 15:50:14.993548 get_reviews.py: Scraping 4671.The_Great_Gatsby...\n", 920 | "2020-10-16 15:50:14.993596 get_reviews.py: #3 out of 15 books\n", 921 | "Scraped page 1\n", 922 | "Scraped page 2\n", 923 | "Scraped page 3\n", 924 | "🚨 ElementClickInterceptedException (Likely a pop-up)🚨\n", 925 | "🔄 Refreshing Goodreads site and skipping problem page 4🔄\n", 926 | "🚨 ElementClickInterceptedException (Likely a pop-up)🚨\n", 927 | "🔄 Refreshing Goodreads site and skipping problem page 5🔄\n", 928 | "🚨 ElementClickInterceptedException (Likely a pop-up)🚨\n", 929 | "🔄 Refreshing Goodreads site and skipping problem page 6🔄\n", 930 | "🚨 ElementClickInterceptedException (Likely a pop-up)🚨\n", 931 | "🔄 Refreshing Goodreads site and skipping problem page 7🔄\n", 932 | "🚨 ElementClickInterceptedException (Likely a pop-up)🚨\n", 933 | "🔄 Refreshing Goodreads site and skipping problem page 8🔄\n", 934 | "🚨 ElementClickInterceptedException (Likely a pop-up)🚨\n", 935 | "🔄 Refreshing Goodreads site and skipping problem page 9🔄\n", 936 | "2020-10-16 15:51:13.294371 get_reviews.py: Scraped ✨90✨ reviews for 4671.The_Great_Gatsby\n", 937 | "=============================\n", 938 | "2020-10-16 15:51:13.300570 get_reviews.py: Scraping 10210.Jane_Eyre...\n", 939 | "2020-10-16 15:51:13.300592 get_reviews.py: #4 out of 15 books\n", 940 | "Scraped page 1\n", 941 | "Scraped page 2\n", 942 | "Scraped page 3\n", 943 | "Scraped page 4\n", 944 | "Scraped page 5\n", 945 | "Scraped page 6\n", 946 | "Scraped page 7\n", 947 | "Scraped page 8\n", 948 | "Scraped page 9\n", 949 | "Scraped page 10\n", 950 | "2020-10-16 15:51:55.747203 get_reviews.py: Scraped ✨300✨ reviews for 10210.Jane_Eyre\n", 951 | "=============================\n", 952 | "2020-10-16 15:51:55.770703 get_reviews.py: Scraping 1371.The_Iliad...\n", 953 | "2020-10-16 15:51:55.770720 get_reviews.py: #5 out of 15 books\n", 954 | "Scraped page 1\n", 955 | "Scraped page 2\n", 956 | "Scraped page 3\n", 957 | "Scraped page 4\n", 958 | "Scraped page 5\n", 959 | "Scraped page 6\n", 960 | "Scraped page 7\n", 961 | "Scraped page 8\n", 962 | "Scraped page 9\n", 963 | "Scraped page 10\n", 964 | "2020-10-16 15:52:36.237778 get_reviews.py: Scraped ✨300✨ reviews for 1371.The_Iliad\n", 965 | "=============================\n", 966 | "2020-10-16 15:52:36.253734 get_reviews.py: Scraping 6185.Wuthering_Heights...\n", 967 | "2020-10-16 15:52:36.253752 get_reviews.py: #6 out of 15 books\n", 968 | "Scraped page 1\n", 969 | "Scraped page 2\n", 970 | "Scraped page 3\n", 971 | "Scraped page 4\n", 972 | "Scraped page 5\n", 973 | "Scraped page 6\n", 974 | "Scraped page 7\n", 975 | "Scraped page 8\n", 976 | "Scraped page 9\n", 977 | "Scraped page 10\n", 978 | "2020-10-16 15:53:17.215696 get_reviews.py: Scraped ✨300✨ reviews for 6185.Wuthering_Heights\n", 979 | "=============================\n", 980 | "2020-10-16 15:53:17.233707 get_reviews.py: Scraping 5107.The_Catcher_in_the_Rye...\n", 981 | "2020-10-16 15:53:17.233728 get_reviews.py: #7 out of 15 books\n", 982 | "Scraped page 1\n", 983 | "Scraped page 2\n", 984 | "Scraped page 3\n", 985 | "Scraped page 4\n", 986 | "Scraped page 5\n", 987 | "Scraped page 6\n", 988 | "Scraped page 7\n", 989 | "Scraped page 8\n", 990 | "Scraped page 9\n", 991 | "Scraped page 10\n", 992 | "2020-10-16 15:53:58.573529 get_reviews.py: Scraped ✨299✨ reviews for 5107.The_Catcher_in_the_Rye\n", 993 | "=============================\n", 994 | "2020-10-16 15:53:58.602727 get_reviews.py: Scraping 11337.The_Bluest_Eye...\n", 995 | "2020-10-16 15:53:58.602753 get_reviews.py: #8 out of 15 books\n", 996 | "Scraped page 1\n", 997 | "Scraped page 2\n", 998 | "Scraped page 3\n", 999 | "Scraped page 4\n", 1000 | "Scraped page 5\n", 1001 | "Scraped page 6\n", 1002 | "Scraped page 7\n", 1003 | "Scraped page 8\n", 1004 | "Scraped page 9\n", 1005 | "Scraped page 10\n", 1006 | "2020-10-16 15:54:38.357758 get_reviews.py: Scraped ✨300✨ reviews for 11337.The_Bluest_Eye\n", 1007 | "=============================\n", 1008 | "2020-10-16 15:54:38.376343 get_reviews.py: Scraping 320.One_Hundred_Years_of_Solitude...\n", 1009 | "2020-10-16 15:54:38.376364 get_reviews.py: #9 out of 15 books\n", 1010 | "Scraped page 1\n", 1011 | "Scraped page 2\n", 1012 | "Scraped page 3\n", 1013 | "Scraped page 4\n", 1014 | "Scraped page 5\n", 1015 | "Scraped page 6\n", 1016 | "Scraped page 7\n", 1017 | "Scraped page 8\n", 1018 | "Scraped page 9\n", 1019 | "Scraped page 10\n", 1020 | "2020-10-16 15:55:19.521779 get_reviews.py: Scraped ✨300✨ reviews for 320.One_Hundred_Years_of_Solitude\n", 1021 | "=============================\n", 1022 | "2020-10-16 15:55:19.536372 get_reviews.py: Scraping 36529.Narrative_of_the_Life_of_Frederick_Douglass...\n", 1023 | "2020-10-16 15:55:19.536427 get_reviews.py: #10 out of 15 books\n", 1024 | "Scraped page 1\n", 1025 | "Scraped page 2\n", 1026 | "Scraped page 3\n", 1027 | "Scraped page 4\n", 1028 | "Scraped page 5\n", 1029 | "Scraped page 6\n", 1030 | "Scraped page 7\n", 1031 | "Scraped page 8\n", 1032 | "Scraped page 9\n", 1033 | "Scraped page 10\n", 1034 | "2020-10-16 15:56:02.153638 get_reviews.py: Scraped ✨300✨ reviews for 36529.Narrative_of_the_Life_of_Frederick_Douglass\n", 1035 | "=============================\n", 1036 | "2020-10-16 15:56:02.170347 get_reviews.py: Scraping 1934.Little_Women...\n", 1037 | "2020-10-16 15:56:02.170369 get_reviews.py: #11 out of 15 books\n", 1038 | "Scraped page 1\n", 1039 | "Scraped page 2\n", 1040 | "Scraped page 3\n", 1041 | "Scraped page 4\n", 1042 | "Scraped page 5\n", 1043 | "Scraped page 6\n", 1044 | "Scraped page 7\n", 1045 | "Scraped page 8\n", 1046 | "Scraped page 9\n", 1047 | "Scraped page 10\n", 1048 | "2020-10-16 15:56:52.025971 get_reviews.py: Scraped ✨300✨ reviews for 1934.Little_Women\n", 1049 | "=============================\n", 1050 | "2020-10-16 15:56:52.053434 get_reviews.py: Scraping 12296.The_Scarlet_Letter...\n", 1051 | "2020-10-16 15:56:52.053457 get_reviews.py: #12 out of 15 books\n", 1052 | "Scraped page 1\n", 1053 | "Scraped page 2\n", 1054 | "Scraped page 3\n", 1055 | "Scraped page 4\n", 1056 | "Scraped page 5\n", 1057 | "Scraped page 6\n", 1058 | "Scraped page 7\n", 1059 | "Scraped page 8\n", 1060 | "Scraped page 9\n", 1061 | "Scraped page 10\n", 1062 | "2020-10-16 15:57:38.575974 get_reviews.py: Scraped ✨300✨ reviews for 12296.The_Scarlet_Letter\n", 1063 | "=============================\n", 1064 | "2020-10-16 15:57:38.592949 get_reviews.py: Scraping 18423.The_Left_Hand_of_Darkness...\n", 1065 | "2020-10-16 15:57:38.592966 get_reviews.py: #13 out of 15 books\n", 1066 | "Scraped page 1\n", 1067 | "Scraped page 2\n", 1068 | "Scraped page 3\n", 1069 | "Scraped page 4\n", 1070 | "Scraped page 5\n", 1071 | "Scraped page 6\n", 1072 | "Scraped page 7\n", 1073 | "Scraped page 8\n", 1074 | "Scraped page 9\n", 1075 | "Scraped page 10\n", 1076 | "2020-10-16 15:58:24.981084 get_reviews.py: Scraped ✨300✨ reviews for 18423.The_Left_Hand_of_Darkness\n", 1077 | "=============================\n", 1078 | "2020-10-16 15:58:25.003677 get_reviews.py: Scraping 14942.Mrs_Dalloway...\n", 1079 | "2020-10-16 15:58:25.003701 get_reviews.py: #14 out of 15 books\n", 1080 | "Scraped page 1\n", 1081 | "Scraped page 2\n", 1082 | "Scraped page 3\n", 1083 | "Scraped page 4\n", 1084 | "Scraped page 5\n", 1085 | "Scraped page 6\n", 1086 | "Scraped page 7\n", 1087 | "Scraped page 8\n", 1088 | "Scraped page 9\n", 1089 | "Scraped page 10\n", 1090 | "2020-10-16 15:59:09.174032 get_reviews.py: Scraped ✨300✨ reviews for 14942.Mrs_Dalloway\n", 1091 | "=============================\n", 1092 | "2020-10-16 15:59:09.205588 get_reviews.py: Scraping 38447.The_Handmaid_s_Tale...\n", 1093 | "2020-10-16 15:59:09.205618 get_reviews.py: #15 out of 15 books\n", 1094 | "Scraped page 1\n", 1095 | "Scraped page 2\n", 1096 | "Scraped page 3\n", 1097 | "Scraped page 4\n", 1098 | "Scraped page 5\n", 1099 | "Scraped page 6\n", 1100 | "Scraped page 7\n", 1101 | "Scraped page 8\n", 1102 | "Scraped page 9\n", 1103 | "Scraped page 10\n", 1104 | "2020-10-16 15:59:50.792094 get_reviews.py: Scraped ✨300✨ reviews for 38447.The_Handmaid_s_Tale\n", 1105 | "=============================\n", 1106 | "2020-10-16 15:59:53.336971 get_reviews.py:\n", 1107 | "\n", 1108 | "🎉 Success! All book reviews scraped. 🎉\n", 1109 | "\n", 1110 | "Goodreads review files have been output to /classic_book_reviews\n", 1111 | "Goodreads scraping run time = ⏰ 0:13:20.389575 ⏰\n" 1112 | ] 1113 | } 1114 | ], 1115 | "source": [ 1116 | "!python get_reviews.py --book_ids_path goodreads_classics_sample.txt \\\n", 1117 | "--output_directory_path classic_book_reviews --sort_order default --browser chrome " 1118 | ] 1119 | }, 1120 | { 1121 | "cell_type": "markdown", 1122 | "metadata": {}, 1123 | "source": [ 1124 | "Let's read in the aggregated JSON file with Pandas and see what the data looks like:" 1125 | ] 1126 | }, 1127 | { 1128 | "cell_type": "code", 1129 | "execution_count": 20, 1130 | "metadata": { 1131 | "scrolled": true 1132 | }, 1133 | "outputs": [ 1134 | { 1135 | "data": { 1136 | "text/html": [ 1137 | "
\n", 1138 | "\n", 1151 | "\n", 1152 | " \n", 1153 | " \n", 1154 | " \n", 1155 | " \n", 1156 | " \n", 1157 | " \n", 1158 | " \n", 1159 | " \n", 1160 | " \n", 1161 | " \n", 1162 | " \n", 1163 | " \n", 1164 | " \n", 1165 | " \n", 1166 | " \n", 1167 | " \n", 1168 | " \n", 1169 | " \n", 1170 | " \n", 1171 | " \n", 1172 | " \n", 1173 | " \n", 1174 | " \n", 1175 | " \n", 1176 | " \n", 1177 | " \n", 1178 | " \n", 1179 | " \n", 1180 | " \n", 1181 | " \n", 1182 | " \n", 1183 | " \n", 1184 | " \n", 1185 | " \n", 1186 | " \n", 1187 | " \n", 1188 | " \n", 1189 | " \n", 1190 | " \n", 1191 | " \n", 1192 | " \n", 1193 | " \n", 1194 | " \n", 1195 | " \n", 1196 | " \n", 1197 | " \n", 1198 | " \n", 1199 | " \n", 1200 | " \n", 1201 | " \n", 1202 | " \n", 1203 | " \n", 1204 | " \n", 1205 | " \n", 1206 | " \n", 1207 | " \n", 1208 | " \n", 1209 | " \n", 1210 | " \n", 1211 | " \n", 1212 | " \n", 1213 | " \n", 1214 | " \n", 1215 | " \n", 1216 | " \n", 1217 | " \n", 1218 | " \n", 1219 | " \n", 1220 | " \n", 1221 | " \n", 1222 | " \n", 1223 | " \n", 1224 | " \n", 1225 | " \n", 1226 | " \n", 1227 | " \n", 1228 | " \n", 1229 | " \n", 1230 | " \n", 1231 | " \n", 1232 | " \n", 1233 | " \n", 1234 | " \n", 1235 | " \n", 1236 | " \n", 1237 | " \n", 1238 | " \n", 1239 | " \n", 1240 | " \n", 1241 | " \n", 1242 | " \n", 1243 | " \n", 1244 | " \n", 1245 | " \n", 1246 | " \n", 1247 | " \n", 1248 | " \n", 1249 | " \n", 1250 | " \n", 1251 | " \n", 1252 | " \n", 1253 | " \n", 1254 | " \n", 1255 | " \n", 1256 | " \n", 1257 | " \n", 1258 | " \n", 1259 | " \n", 1260 | " \n", 1261 | " \n", 1262 | " \n", 1263 | " \n", 1264 | " \n", 1265 | " \n", 1266 | " \n", 1267 | " \n", 1268 | " \n", 1269 | " \n", 1270 | " \n", 1271 | " \n", 1272 | " \n", 1273 | " \n", 1274 | " \n", 1275 | " \n", 1276 | " \n", 1277 | " \n", 1278 | " \n", 1279 | " \n", 1280 | " \n", 1281 | " \n", 1282 | " \n", 1283 | " \n", 1284 | " \n", 1285 | " \n", 1286 | " \n", 1287 | " \n", 1288 | " \n", 1289 | " \n", 1290 | " \n", 1291 | " \n", 1292 | " \n", 1293 | " \n", 1294 | " \n", 1295 | " \n", 1296 | " \n", 1297 | " \n", 1298 | " \n", 1299 | " \n", 1300 | " \n", 1301 | " \n", 1302 | " \n", 1303 | " \n", 1304 | " \n", 1305 | " \n", 1306 | " \n", 1307 | " \n", 1308 | " \n", 1309 | " \n", 1310 | " \n", 1311 | " \n", 1312 | " \n", 1313 | " \n", 1314 | " \n", 1315 | " \n", 1316 | " \n", 1317 | " \n", 1318 | " \n", 1319 | " \n", 1320 | " \n", 1321 | " \n", 1322 | " \n", 1323 | " \n", 1324 | " \n", 1325 | " \n", 1326 | " \n", 1327 | " \n", 1328 | " \n", 1329 | " \n", 1330 | " \n", 1331 | " \n", 1332 | " \n", 1333 | " \n", 1334 | " \n", 1335 | " \n", 1336 | " \n", 1337 | " \n", 1338 | " \n", 1339 | " \n", 1340 | " \n", 1341 | " \n", 1342 | " \n", 1343 | " \n", 1344 | " \n", 1345 | " \n", 1346 | " \n", 1347 | " \n", 1348 | "
book_id_titlebook_idbook_titlereview_urlreview_iddateratinguser_nameuser_urltextnum_likessort_ordershelves
0320.One_Hundred_Years_of_Solitude320One Hundred Years of Solitudehttps://www.goodreads.com/review/show/14889645148896452008-02-083Chris/user/show/858949-chrisRevised 28 March 2012Huh? Oh. Oh, man. Wow.I j...1527default[fantasy]
1320.One_Hundred_Years_of_Solitude320One Hundred Years of Solitudehttps://www.goodreads.com/review/show/42810714428107142009-01-125Meg/user/show/1009267-megI guarantee that 95% of you will hate this boo...1833default[]
2320.One_Hundred_Years_of_Solitude320One Hundred Years of Solitudehttps://www.goodreads.com/review/show/11478967114789672008-01-021Adam/user/show/735606-adamSo I know that I'm supposed to like this book ...1342default[classics]
3320.One_Hundred_Years_of_Solitude320One Hundred Years of Solitudehttps://www.goodreads.com/review/show/9771616049771616042014-06-255Lisa/user/show/32532774-lisa\"What is your favourite book, mum?\" How many t...592default[favorites, havanas-en-masse, unforgettable, n...
4320.One_Hundred_Years_of_Solitude320One Hundred Years of Solitudehttps://www.goodreads.com/review/show/24243058242430582008-06-111Laura/user/show/1040930-lauraMore like A Hundred Years of Torture. I read t...549default[]
..........................................
42841934.Little_Women1934Little Womenhttps://www.goodreads.com/review/show/168977750516897775052019-12-113Leah/user/show/9846570-leahThis book is huge! It was originally published...9default[]
42851934.Little_Women1934Little Womenhttps://www.goodreads.com/review/show/140737270514073727052015-10-035Kara Swanson/user/show/30110097-kara-swansonWhat can I say? Its a classic for a reason. Th...9default[magical-classics]
42861934.Little_Women1934Little Womenhttps://www.goodreads.com/review/show/173622373417362237342016-08-224Rosemarie/user/show/49876976-rosemarieThis charming book is deservedly a classic. Th...9default[guardian-1000, rosemarie-19th-century-10]
42871934.Little_Women1934Little Womenhttps://www.goodreads.com/review/show/227455403422745540342018-01-275Rosemary Atwell/user/show/15847499-rosemary-atwellA twenty-year revisitation of another of my v...9default[re-reads]
42881934.Little_Women1934Little Womenhttps://www.goodreads.com/review/show/161725385516172538552018-12-264Julia (Shakespeare and Such)/user/show/19086853-julia-shakespeare-and-such4.6/5 stars! Reread and I’m surprised that my ...9default[classics, middle-grade]
\n", 1349 | "

4289 rows × 13 columns

\n", 1350 | "
" 1351 | ], 1352 | "text/plain": [ 1353 | " book_id_title book_id \\\n", 1354 | "0 320.One_Hundred_Years_of_Solitude 320 \n", 1355 | "1 320.One_Hundred_Years_of_Solitude 320 \n", 1356 | "2 320.One_Hundred_Years_of_Solitude 320 \n", 1357 | "3 320.One_Hundred_Years_of_Solitude 320 \n", 1358 | "4 320.One_Hundred_Years_of_Solitude 320 \n", 1359 | "... ... ... \n", 1360 | "4284 1934.Little_Women 1934 \n", 1361 | "4285 1934.Little_Women 1934 \n", 1362 | "4286 1934.Little_Women 1934 \n", 1363 | "4287 1934.Little_Women 1934 \n", 1364 | "4288 1934.Little_Women 1934 \n", 1365 | "\n", 1366 | " book_title \\\n", 1367 | "0 One Hundred Years of Solitude \n", 1368 | "1 One Hundred Years of Solitude \n", 1369 | "2 One Hundred Years of Solitude \n", 1370 | "3 One Hundred Years of Solitude \n", 1371 | "4 One Hundred Years of Solitude \n", 1372 | "... ... \n", 1373 | "4284 Little Women \n", 1374 | "4285 Little Women \n", 1375 | "4286 Little Women \n", 1376 | "4287 Little Women \n", 1377 | "4288 Little Women \n", 1378 | "\n", 1379 | " review_url review_id date \\\n", 1380 | "0 https://www.goodreads.com/review/show/14889645 14889645 2008-02-08 \n", 1381 | "1 https://www.goodreads.com/review/show/42810714 42810714 2009-01-12 \n", 1382 | "2 https://www.goodreads.com/review/show/11478967 11478967 2008-01-02 \n", 1383 | "3 https://www.goodreads.com/review/show/977161604 977161604 2014-06-25 \n", 1384 | "4 https://www.goodreads.com/review/show/24243058 24243058 2008-06-11 \n", 1385 | "... ... ... ... \n", 1386 | "4284 https://www.goodreads.com/review/show/1689777505 1689777505 2019-12-11 \n", 1387 | "4285 https://www.goodreads.com/review/show/1407372705 1407372705 2015-10-03 \n", 1388 | "4286 https://www.goodreads.com/review/show/1736223734 1736223734 2016-08-22 \n", 1389 | "4287 https://www.goodreads.com/review/show/2274554034 2274554034 2018-01-27 \n", 1390 | "4288 https://www.goodreads.com/review/show/1617253855 1617253855 2018-12-26 \n", 1391 | "\n", 1392 | " rating user_name \\\n", 1393 | "0 3 Chris \n", 1394 | "1 5 Meg \n", 1395 | "2 1 Adam \n", 1396 | "3 5 Lisa \n", 1397 | "4 1 Laura \n", 1398 | "... ... ... \n", 1399 | "4284 3 Leah \n", 1400 | "4285 5 Kara Swanson \n", 1401 | "4286 4 Rosemarie \n", 1402 | "4287 5 Rosemary Atwell \n", 1403 | "4288 4 Julia (Shakespeare and Such) \n", 1404 | "\n", 1405 | " user_url \\\n", 1406 | "0 /user/show/858949-chris \n", 1407 | "1 /user/show/1009267-meg \n", 1408 | "2 /user/show/735606-adam \n", 1409 | "3 /user/show/32532774-lisa \n", 1410 | "4 /user/show/1040930-laura \n", 1411 | "... ... \n", 1412 | "4284 /user/show/9846570-leah \n", 1413 | "4285 /user/show/30110097-kara-swanson \n", 1414 | "4286 /user/show/49876976-rosemarie \n", 1415 | "4287 /user/show/15847499-rosemary-atwell \n", 1416 | "4288 /user/show/19086853-julia-shakespeare-and-such \n", 1417 | "\n", 1418 | " text num_likes sort_order \\\n", 1419 | "0 Revised 28 March 2012Huh? Oh. Oh, man. Wow.I j... 1527 default \n", 1420 | "1 I guarantee that 95% of you will hate this boo... 1833 default \n", 1421 | "2 So I know that I'm supposed to like this book ... 1342 default \n", 1422 | "3 \"What is your favourite book, mum?\" How many t... 592 default \n", 1423 | "4 More like A Hundred Years of Torture. I read t... 549 default \n", 1424 | "... ... ... ... \n", 1425 | "4284 This book is huge! It was originally published... 9 default \n", 1426 | "4285 What can I say? Its a classic for a reason. Th... 9 default \n", 1427 | "4286 This charming book is deservedly a classic. Th... 9 default \n", 1428 | "4287 A twenty-year revisitation of another of my v... 9 default \n", 1429 | "4288 4.6/5 stars! Reread and I’m surprised that my ... 9 default \n", 1430 | "\n", 1431 | " shelves \n", 1432 | "0 [fantasy] \n", 1433 | "1 [] \n", 1434 | "2 [classics] \n", 1435 | "3 [favorites, havanas-en-masse, unforgettable, n... \n", 1436 | "4 [] \n", 1437 | "... ... \n", 1438 | "4284 [] \n", 1439 | "4285 [magical-classics] \n", 1440 | "4286 [guardian-1000, rosemarie-19th-century-10] \n", 1441 | "4287 [re-reads] \n", 1442 | "4288 [classics, middle-grade] \n", 1443 | "\n", 1444 | "[4289 rows x 13 columns]" 1445 | ] 1446 | }, 1447 | "execution_count": 20, 1448 | "metadata": {}, 1449 | "output_type": "execute_result" 1450 | } 1451 | ], 1452 | "source": [ 1453 | "reviews_df = pd.read_json('classic_book_reviews/all_reviews.json')\n", 1454 | "reviews_df" 1455 | ] 1456 | }, 1457 | { 1458 | "cell_type": "markdown", 1459 | "metadata": {}, 1460 | "source": [ 1461 | "How many Goodreads reviews did we collect for each book?" 1462 | ] 1463 | }, 1464 | { 1465 | "cell_type": "code", 1466 | "execution_count": 21, 1467 | "metadata": {}, 1468 | "outputs": [ 1469 | { 1470 | "data": { 1471 | "text/plain": [ 1472 | "To Kill a Mockingbird 300\n", 1473 | "The Iliad 300\n", 1474 | "Wuthering Heights 300\n", 1475 | "One Hundred Years of Solitude 300\n", 1476 | "The Scarlet Letter 300\n", 1477 | "Narrative of the Life of Frederick Douglass 300\n", 1478 | "The Left Hand of Darkness 300\n", 1479 | "The Bluest Eye 300\n", 1480 | "Jane Eyre 300\n", 1481 | "Mrs. Dalloway 300\n", 1482 | "Little Women 300\n", 1483 | "Pride and Prejudice 300\n", 1484 | "The Handmaid's Tale 300\n", 1485 | "The Catcher in the Rye 299\n", 1486 | "The Great Gatsby 90\n", 1487 | "Name: book_title, dtype: int64" 1488 | ] 1489 | }, 1490 | "execution_count": 21, 1491 | "metadata": {}, 1492 | "output_type": "execute_result" 1493 | } 1494 | ], 1495 | "source": [ 1496 | "reviews_df['book_title'].value_counts()" 1497 | ] 1498 | }, 1499 | { 1500 | "cell_type": "markdown", 1501 | "metadata": {}, 1502 | "source": [ 1503 | "How many Goodreads reviews did we collect in total?" 1504 | ] 1505 | }, 1506 | { 1507 | "cell_type": "code", 1508 | "execution_count": 22, 1509 | "metadata": {}, 1510 | "outputs": [ 1511 | { 1512 | "data": { 1513 | "text/plain": [ 1514 | "4289" 1515 | ] 1516 | }, 1517 | "execution_count": 22, 1518 | "metadata": {}, 1519 | "output_type": "execute_result" 1520 | } 1521 | ], 1522 | "source": [ 1523 | "len(reviews_df)" 1524 | ] 1525 | }, 1526 | { 1527 | "cell_type": "markdown", 1528 | "metadata": {}, 1529 | "source": [ 1530 | "## Count duplicates" 1531 | ] 1532 | }, 1533 | { 1534 | "cell_type": "markdown", 1535 | "metadata": {}, 1536 | "source": [ 1537 | "How many duplicate reviews are in this data?" 1538 | ] 1539 | }, 1540 | { 1541 | "cell_type": "code", 1542 | "execution_count": null, 1543 | "metadata": {}, 1544 | "outputs": [], 1545 | "source": [ 1546 | "len(reviews_df[reviews_df[['book_title','text', 'user_name', 'user_url']].duplicated(keep=False)])" 1547 | ] 1548 | }, 1549 | { 1550 | "cell_type": "markdown", 1551 | "metadata": {}, 1552 | "source": [ 1553 | "Let's examine the duplicates (lots of spam/bots?):" 1554 | ] 1555 | }, 1556 | { 1557 | "cell_type": "code", 1558 | "execution_count": 24, 1559 | "metadata": { 1560 | "scrolled": true 1561 | }, 1562 | "outputs": [ 1563 | { 1564 | "data": { 1565 | "text/html": [ 1566 | "
\n", 1567 | "\n", 1580 | "\n", 1581 | " \n", 1582 | " \n", 1583 | " \n", 1584 | " \n", 1585 | " \n", 1586 | " \n", 1587 | " \n", 1588 | " \n", 1589 | " \n", 1590 | " \n", 1591 | " \n", 1592 | " \n", 1593 | " \n", 1594 | " \n", 1595 | " \n", 1596 | " \n", 1597 | " \n", 1598 | " \n", 1599 | " \n", 1600 | " \n", 1601 | " \n", 1602 | " \n", 1603 | " \n", 1604 | " \n", 1605 | " \n", 1606 | " \n", 1607 | " \n", 1608 | " \n", 1609 | " \n", 1610 | " \n", 1611 | " \n", 1612 | " \n", 1613 | " \n", 1614 | " \n", 1615 | " \n", 1616 | " \n", 1617 | " \n", 1618 | " \n", 1619 | " \n", 1620 | " \n", 1621 | " \n", 1622 | " \n", 1623 | " \n", 1624 | " \n", 1625 | " \n", 1626 | " \n", 1627 | " \n", 1628 | " \n", 1629 | " \n", 1630 | " \n", 1631 | " \n", 1632 | " \n", 1633 | "
book_id_titlebook_idbook_titlereview_urlreview_iddateratinguser_nameuser_urltextnum_likessort_ordershelves
317911337.The_Bluest_Eye11337The Bluest Eyehttps://www.goodreads.com/review/show/343732860134373286012020-07-115Amanda Hupe/user/show/11658047-amanda-hupe“Certain seeds it will not nurture, certain fr...9default[2020-reads]
324611337.The_Bluest_Eye11337The Bluest Eyehttps://www.goodreads.com/review/show/342071051734207105172020-07-085Amanda Hupe/user/show/11658047-amanda-hupe“Certain seeds it will not nurture, certain fr...5default[2020-reads]
\n", 1634 | "
" 1635 | ], 1636 | "text/plain": [ 1637 | " book_id_title book_id book_title \\\n", 1638 | "3179 11337.The_Bluest_Eye 11337 The Bluest Eye \n", 1639 | "3246 11337.The_Bluest_Eye 11337 The Bluest Eye \n", 1640 | "\n", 1641 | " review_url review_id date \\\n", 1642 | "3179 https://www.goodreads.com/review/show/3437328601 3437328601 2020-07-11 \n", 1643 | "3246 https://www.goodreads.com/review/show/3420710517 3420710517 2020-07-08 \n", 1644 | "\n", 1645 | " rating user_name user_url \\\n", 1646 | "3179 5 Amanda Hupe /user/show/11658047-amanda-hupe \n", 1647 | "3246 5 Amanda Hupe /user/show/11658047-amanda-hupe \n", 1648 | "\n", 1649 | " text num_likes sort_order \\\n", 1650 | "3179 “Certain seeds it will not nurture, certain fr... 9 default \n", 1651 | "3246 “Certain seeds it will not nurture, certain fr... 5 default \n", 1652 | "\n", 1653 | " shelves \n", 1654 | "3179 [2020-reads] \n", 1655 | "3246 [2020-reads] " 1656 | ] 1657 | }, 1658 | "execution_count": 24, 1659 | "metadata": {}, 1660 | "output_type": "execute_result" 1661 | } 1662 | ], 1663 | "source": [ 1664 | "reviews_df[reviews_df[['book_title','text', 'user_name', 'user_url']].duplicated(keep=False)]" 1665 | ] 1666 | }, 1667 | { 1668 | "cell_type": "markdown", 1669 | "metadata": {}, 1670 | "source": [ 1671 | "Drop duplicates" 1672 | ] 1673 | }, 1674 | { 1675 | "cell_type": "code", 1676 | "execution_count": 27, 1677 | "metadata": {}, 1678 | "outputs": [], 1679 | "source": [ 1680 | "reviews_df[['book_title','text', 'user_name', 'user_url']] = reviews_df[['book_title','text', 'user_name', 'user_url']].drop_duplicates(keep='first')" 1681 | ] 1682 | }, 1683 | { 1684 | "cell_type": "code", 1685 | "execution_count": 28, 1686 | "metadata": {}, 1687 | "outputs": [ 1688 | { 1689 | "data": { 1690 | "text/html": [ 1691 | "
\n", 1692 | "\n", 1705 | "\n", 1706 | " \n", 1707 | " \n", 1708 | " \n", 1709 | " \n", 1710 | " \n", 1711 | " \n", 1712 | " \n", 1713 | " \n", 1714 | " \n", 1715 | " \n", 1716 | " \n", 1717 | " \n", 1718 | " \n", 1719 | " \n", 1720 | " \n", 1721 | " \n", 1722 | " \n", 1723 | " \n", 1724 | " \n", 1725 | " \n", 1726 | "
book_id_titlebook_idbook_titlereview_urlreview_iddateratinguser_nameuser_urltextnum_likessort_ordershelves
\n", 1727 | "
" 1728 | ], 1729 | "text/plain": [ 1730 | "Empty DataFrame\n", 1731 | "Columns: [book_id_title, book_id, book_title, review_url, review_id, date, rating, user_name, user_url, text, num_likes, sort_order, shelves]\n", 1732 | "Index: []" 1733 | ] 1734 | }, 1735 | "execution_count": 28, 1736 | "metadata": {}, 1737 | "output_type": "execute_result" 1738 | } 1739 | ], 1740 | "source": [ 1741 | "reviews_df[reviews_df[['book_title','text', 'user_name', 'user_url']].duplicated(keep=False)]" 1742 | ] 1743 | }, 1744 | { 1745 | "cell_type": "markdown", 1746 | "metadata": {}, 1747 | "source": [ 1748 | "Output to CSV file" 1749 | ] 1750 | }, 1751 | { 1752 | "cell_type": "code", 1753 | "execution_count": 30, 1754 | "metadata": {}, 1755 | "outputs": [], 1756 | "source": [ 1757 | "reviews_df.to_csv(\"all_goodreads_reviews.csv\", encoding ='utf-8', index=False)" 1758 | ] 1759 | }, 1760 | { 1761 | "cell_type": "markdown", 1762 | "metadata": {}, 1763 | "source": [ 1764 | "## Collect Newest Goodreads Reviews (Firefox)" 1765 | ] 1766 | }, 1767 | { 1768 | "cell_type": "markdown", 1769 | "metadata": {}, 1770 | "source": [ 1771 | "## Make new directory for book reviews" 1772 | ] 1773 | }, 1774 | { 1775 | "cell_type": "markdown", 1776 | "metadata": {}, 1777 | "source": [ 1778 | "Make new folder for newest Goodreads reviews" 1779 | ] 1780 | }, 1781 | { 1782 | "cell_type": "code", 1783 | "execution_count": 21, 1784 | "metadata": {}, 1785 | "outputs": [], 1786 | "source": [ 1787 | "!mkdir classic_book_reviews_newest" 1788 | ] 1789 | }, 1790 | { 1791 | "cell_type": "markdown", 1792 | "metadata": {}, 1793 | "source": [ 1794 | "## Run Goodreads reviews collection script" 1795 | ] 1796 | }, 1797 | { 1798 | "cell_type": "markdown", 1799 | "metadata": {}, 1800 | "source": [ 1801 | "Below we're running `get_reviews.py`, setting `--sort_order` to `newest` to collect the most recently published Goodreads reviews, indicating that the web browser we'd like to use is Firefox, and setting the file format of the aggregated reviews as a CSV file (in addition to a JSON file)." 1802 | ] 1803 | }, 1804 | { 1805 | "cell_type": "code", 1806 | "execution_count": 5, 1807 | "metadata": { 1808 | "scrolled": true 1809 | }, 1810 | "outputs": [ 1811 | { 1812 | "name": "stdout", 1813 | "output_type": "stream", 1814 | "text": [ 1815 | "2020-10-16 14:26:51.613647 get_reviews.py: Scraping 4671.The_Great_Gatsby...\n", 1816 | "2020-10-16 14:26:51.613765 get_reviews.py: #3 out of 15 books\n", 1817 | "Scraped page 1\n", 1818 | "Scraped page 2\n", 1819 | "Scraped page 3\n", 1820 | "Scraped page 4\n", 1821 | "Scraped page 5\n", 1822 | "Scraped page 6\n", 1823 | "Scraped page 7\n", 1824 | "Scraped page 8\n", 1825 | "Scraped page 9\n", 1826 | "Scraped page 10\n", 1827 | "2020-10-16 14:27:52.671204 get_reviews.py: Scraped ✨300✨ reviews for 4671.The_Great_Gatsby\n", 1828 | "=============================\n", 1829 | "2020-10-16 14:27:52.683197 get_reviews.py: Scraping 10210.Jane_Eyre...\n", 1830 | "2020-10-16 14:27:52.683215 get_reviews.py: #4 out of 15 books\n", 1831 | "🚨 ElementClickInterceptedException 🚨\n", 1832 | "Refreshing Goodreads site and rescraping book\n", 1833 | "Scraped page 1\n", 1834 | "Scraped page 2\n", 1835 | "Scraped page 3\n", 1836 | "Scraped page 4\n", 1837 | "Scraped page 5\n", 1838 | "Scraped page 6\n", 1839 | "Scraped page 7\n", 1840 | "Scraped page 8\n", 1841 | "Scraped page 9\n", 1842 | "Scraped page 10\n", 1843 | "2020-10-16 14:28:59.189851 get_reviews.py: Scraped ✨300✨ reviews for 10210.Jane_Eyre\n", 1844 | "=============================\n", 1845 | "2020-10-16 14:28:59.212523 get_reviews.py: Scraping 1371.The_Iliad...\n", 1846 | "2020-10-16 14:28:59.212545 get_reviews.py: #5 out of 15 books\n", 1847 | "Scraped page 1\n", 1848 | "Scraped page 2\n", 1849 | "Scraped page 3\n", 1850 | "Scraped page 4\n", 1851 | "Scraped page 5\n", 1852 | "Scraped page 6\n", 1853 | "Scraped page 7\n", 1854 | "Scraped page 8\n", 1855 | "Scraped page 9\n", 1856 | "Scraped page 10\n", 1857 | "2020-10-16 14:29:55.437714 get_reviews.py: Scraped ✨299✨ reviews for 1371.The_Iliad\n", 1858 | "=============================\n", 1859 | "2020-10-16 14:29:55.461226 get_reviews.py: Scraping 6185.Wuthering_Heights...\n", 1860 | "2020-10-16 14:29:55.461250 get_reviews.py: #6 out of 15 books\n", 1861 | "Scraped page 1\n", 1862 | "Scraped page 2\n", 1863 | "Scraped page 3\n", 1864 | "Scraped page 4\n", 1865 | "Scraped page 5\n", 1866 | "Scraped page 6\n", 1867 | "Scraped page 7\n", 1868 | "Scraped page 8\n", 1869 | "Scraped page 9\n", 1870 | "Scraped page 10\n", 1871 | "2020-10-16 14:30:51.039187 get_reviews.py: Scraped ✨300✨ reviews for 6185.Wuthering_Heights\n", 1872 | "=============================\n", 1873 | "2020-10-16 14:30:51.057336 get_reviews.py: Scraping 5107.The_Catcher_in_the_Rye...\n", 1874 | "2020-10-16 14:30:51.057376 get_reviews.py: #7 out of 15 books\n", 1875 | "Scraped page 1\n", 1876 | "Scraped page 2\n", 1877 | "Scraped page 3\n", 1878 | "Scraped page 4\n", 1879 | "Scraped page 5\n", 1880 | "Scraped page 6\n", 1881 | "Scraped page 7\n", 1882 | "Scraped page 8\n", 1883 | "Scraped page 9\n", 1884 | "Scraped page 10\n", 1885 | "2020-10-16 14:31:44.113949 get_reviews.py: Scraped ✨300✨ reviews for 5107.The_Catcher_in_the_Rye\n", 1886 | "=============================\n", 1887 | "2020-10-16 14:31:44.130292 get_reviews.py: Scraping 11337.The_Bluest_Eye...\n", 1888 | "2020-10-16 14:31:44.130314 get_reviews.py: #8 out of 15 books\n", 1889 | "Scraped page 1\n", 1890 | "Scraped page 2\n", 1891 | "Scraped page 3\n", 1892 | "Scraped page 4\n", 1893 | "Scraped page 5\n", 1894 | "Scraped page 6\n", 1895 | "Scraped page 7\n", 1896 | "Scraped page 8\n", 1897 | "Scraped page 9\n", 1898 | "Scraped page 10\n", 1899 | "2020-10-16 14:32:38.841013 get_reviews.py: Scraped ✨300✨ reviews for 11337.The_Bluest_Eye\n", 1900 | "=============================\n", 1901 | "2020-10-16 14:32:38.857938 get_reviews.py: Scraping 320.One_Hundred_Years_of_Solitude...\n", 1902 | "2020-10-16 14:32:38.857961 get_reviews.py: #9 out of 15 books\n", 1903 | "Scraped page 1\n", 1904 | "Scraped page 2\n", 1905 | "Scraped page 3\n", 1906 | "Scraped page 4\n", 1907 | "Scraped page 5\n", 1908 | "Scraped page 6\n", 1909 | "Scraped page 7\n", 1910 | "Scraped page 8\n", 1911 | "Scraped page 9\n", 1912 | "Scraped page 10\n", 1913 | "2020-10-16 14:33:35.687842 get_reviews.py: Scraped ✨300✨ reviews for 320.One_Hundred_Years_of_Solitude\n", 1914 | "=============================\n", 1915 | "2020-10-16 14:33:35.700831 get_reviews.py: Scraping 36529.Narrative_of_the_Life_of_Frederick_Douglass...\n", 1916 | "2020-10-16 14:33:35.700858 get_reviews.py: #10 out of 15 books\n", 1917 | "Scraped page 1\n", 1918 | "Scraped page 2\n", 1919 | "Scraped page 3\n", 1920 | "Scraped page 4\n", 1921 | "Scraped page 5\n", 1922 | "Scraped page 6\n", 1923 | "Scraped page 7\n", 1924 | "Scraped page 8\n", 1925 | "Scraped page 9\n", 1926 | "Scraped page 10\n", 1927 | "2020-10-16 14:34:30.543793 get_reviews.py: Scraped ✨300✨ reviews for 36529.Narrative_of_the_Life_of_Frederick_Douglass\n", 1928 | "=============================\n", 1929 | "2020-10-16 14:34:30.557592 get_reviews.py: Scraping 1934.Little_Women...\n", 1930 | "2020-10-16 14:34:30.557610 get_reviews.py: #11 out of 15 books\n", 1931 | "Scraped page 1\n", 1932 | "Scraped page 2\n", 1933 | "Scraped page 3\n", 1934 | "Scraped page 4\n", 1935 | "Scraped page 5\n", 1936 | "Scraped page 6\n", 1937 | "Scraped page 7\n", 1938 | "Scraped page 8\n", 1939 | "Scraped page 9\n", 1940 | "Scraped page 10\n", 1941 | "2020-10-16 14:35:27.850384 get_reviews.py: Scraped ✨300✨ reviews for 1934.Little_Women\n", 1942 | "=============================\n", 1943 | "2020-10-16 14:35:27.861498 get_reviews.py: Scraping 12296.The_Scarlet_Letter...\n", 1944 | "2020-10-16 14:35:27.861516 get_reviews.py: #12 out of 15 books\n", 1945 | "Scraped page 1\n", 1946 | "Scraped page 2\n", 1947 | "Scraped page 3\n", 1948 | "Scraped page 4\n", 1949 | "Scraped page 5\n", 1950 | "Scraped page 6\n", 1951 | "Scraped page 7\n", 1952 | "Scraped page 8\n", 1953 | "Scraped page 9\n", 1954 | "Scraped page 10\n", 1955 | "2020-10-16 14:36:22.745938 get_reviews.py: Scraped ✨300✨ reviews for 12296.The_Scarlet_Letter\n", 1956 | "=============================\n", 1957 | "2020-10-16 14:36:22.767726 get_reviews.py: Scraping 18423.The_Left_Hand_of_Darkness...\n", 1958 | "2020-10-16 14:36:22.767752 get_reviews.py: #13 out of 15 books\n", 1959 | "Scraped page 1\n", 1960 | "Scraped page 2\n", 1961 | "Scraped page 3\n", 1962 | "Scraped page 4\n", 1963 | "Scraped page 5\n", 1964 | "Scraped page 6\n", 1965 | "Scraped page 7\n", 1966 | "Scraped page 8\n", 1967 | "Scraped page 9\n", 1968 | "Scraped page 10\n", 1969 | "2020-10-16 14:37:16.797874 get_reviews.py: Scraped ✨300✨ reviews for 18423.The_Left_Hand_of_Darkness\n", 1970 | "=============================\n", 1971 | "2020-10-16 14:37:16.827592 get_reviews.py: Scraping 14942.Mrs_Dalloway...\n", 1972 | "2020-10-16 14:37:16.827619 get_reviews.py: #14 out of 15 books\n", 1973 | "Scraped page 1\n", 1974 | "Scraped page 2\n", 1975 | "Scraped page 3\n", 1976 | "Scraped page 4\n", 1977 | "Scraped page 5\n", 1978 | "Scraped page 6\n", 1979 | "Scraped page 7\n", 1980 | "Scraped page 8\n", 1981 | "Scraped page 9\n", 1982 | "Scraped page 10\n", 1983 | "2020-10-16 14:38:11.189933 get_reviews.py: Scraped ✨300✨ reviews for 14942.Mrs_Dalloway\n", 1984 | "=============================\n", 1985 | "2020-10-16 14:38:11.207819 get_reviews.py: Scraping 38447.The_Handmaid_s_Tale...\n", 1986 | "2020-10-16 14:38:11.207845 get_reviews.py: #15 out of 15 books\n", 1987 | "Scraped page 1\n", 1988 | "Scraped page 2\n", 1989 | "Scraped page 3\n", 1990 | "Scraped page 4\n", 1991 | "Scraped page 5\n", 1992 | "Scraped page 6\n", 1993 | "Scraped page 7\n", 1994 | "Scraped page 8\n", 1995 | "Scraped page 9\n", 1996 | "Scraped page 10\n", 1997 | "2020-10-16 14:39:05.388243 get_reviews.py: Scraped ✨300✨ reviews for 38447.The_Handmaid_s_Tale\n", 1998 | "=============================\n", 1999 | "2020-10-16 14:39:08.130923 get_reviews.py:\n", 2000 | "\n", 2001 | "🎉 Success! All book reviews scraped. 🎉\n", 2002 | "\n", 2003 | "Goodreads review files have been output to /classic_book_reviews_newest\n", 2004 | "Goodreads scraping run time = ⏰ 0:12:21.264886 ⏰\n" 2005 | ] 2006 | } 2007 | ], 2008 | "source": [ 2009 | "!python get_reviews.py --book_ids_path goodreads_classics_sample.txt \\\n", 2010 | "--output_directory_path classic_book_reviews_newest --sort_order newest --browser firefox --format csv" 2011 | ] 2012 | }, 2013 | { 2014 | "cell_type": "markdown", 2015 | "metadata": {}, 2016 | "source": [ 2017 | "Let's read in the aggregated CSV file with Pandas and see what the data looks like:" 2018 | ] 2019 | }, 2020 | { 2021 | "cell_type": "code", 2022 | "execution_count": 9, 2023 | "metadata": {}, 2024 | "outputs": [], 2025 | "source": [ 2026 | "newest_reviews = pd.read_csv('classic_book_reviews_newest/all_reviews.csv')" 2027 | ] 2028 | }, 2029 | { 2030 | "cell_type": "code", 2031 | "execution_count": 11, 2032 | "metadata": { 2033 | "scrolled": true 2034 | }, 2035 | "outputs": [ 2036 | { 2037 | "data": { 2038 | "text/html": [ 2039 | "
\n", 2040 | "\n", 2053 | "\n", 2054 | " \n", 2055 | " \n", 2056 | " \n", 2057 | " \n", 2058 | " \n", 2059 | " \n", 2060 | " \n", 2061 | " \n", 2062 | " \n", 2063 | " \n", 2064 | " \n", 2065 | " \n", 2066 | " \n", 2067 | " \n", 2068 | " \n", 2069 | " \n", 2070 | " \n", 2071 | " \n", 2072 | " \n", 2073 | " \n", 2074 | " \n", 2075 | " \n", 2076 | " \n", 2077 | " \n", 2078 | " \n", 2079 | " \n", 2080 | " \n", 2081 | " \n", 2082 | " \n", 2083 | " \n", 2084 | " \n", 2085 | " \n", 2086 | " \n", 2087 | " \n", 2088 | " \n", 2089 | " \n", 2090 | " \n", 2091 | " \n", 2092 | " \n", 2093 | " \n", 2094 | " \n", 2095 | " \n", 2096 | " \n", 2097 | " \n", 2098 | " \n", 2099 | " \n", 2100 | " \n", 2101 | " \n", 2102 | " \n", 2103 | " \n", 2104 | " \n", 2105 | " \n", 2106 | " \n", 2107 | " \n", 2108 | " \n", 2109 | " \n", 2110 | " \n", 2111 | " \n", 2112 | " \n", 2113 | " \n", 2114 | " \n", 2115 | " \n", 2116 | " \n", 2117 | " \n", 2118 | " \n", 2119 | " \n", 2120 | " \n", 2121 | " \n", 2122 | " \n", 2123 | " \n", 2124 | " \n", 2125 | " \n", 2126 | " \n", 2127 | " \n", 2128 | " \n", 2129 | " \n", 2130 | " \n", 2131 | " \n", 2132 | " \n", 2133 | " \n", 2134 | " \n", 2135 | " \n", 2136 | " \n", 2137 | " \n", 2138 | " \n", 2139 | " \n", 2140 | " \n", 2141 | " \n", 2142 | " \n", 2143 | " \n", 2144 | " \n", 2145 | " \n", 2146 | " \n", 2147 | " \n", 2148 | " \n", 2149 | " \n", 2150 | " \n", 2151 | " \n", 2152 | " \n", 2153 | " \n", 2154 | " \n", 2155 | " \n", 2156 | " \n", 2157 | " \n", 2158 | " \n", 2159 | " \n", 2160 | " \n", 2161 | " \n", 2162 | " \n", 2163 | " \n", 2164 | " \n", 2165 | " \n", 2166 | " \n", 2167 | " \n", 2168 | " \n", 2169 | " \n", 2170 | " \n", 2171 | " \n", 2172 | " \n", 2173 | " \n", 2174 | " \n", 2175 | " \n", 2176 | " \n", 2177 | " \n", 2178 | " \n", 2179 | " \n", 2180 | " \n", 2181 | " \n", 2182 | " \n", 2183 | " \n", 2184 | " \n", 2185 | " \n", 2186 | " \n", 2187 | " \n", 2188 | " \n", 2189 | " \n", 2190 | " \n", 2191 | " \n", 2192 | " \n", 2193 | " \n", 2194 | " \n", 2195 | " \n", 2196 | " \n", 2197 | " \n", 2198 | " \n", 2199 | " \n", 2200 | " \n", 2201 | " \n", 2202 | " \n", 2203 | " \n", 2204 | " \n", 2205 | " \n", 2206 | " \n", 2207 | " \n", 2208 | " \n", 2209 | " \n", 2210 | " \n", 2211 | " \n", 2212 | " \n", 2213 | " \n", 2214 | " \n", 2215 | " \n", 2216 | " \n", 2217 | " \n", 2218 | " \n", 2219 | " \n", 2220 | " \n", 2221 | " \n", 2222 | " \n", 2223 | " \n", 2224 | " \n", 2225 | " \n", 2226 | " \n", 2227 | " \n", 2228 | " \n", 2229 | " \n", 2230 | " \n", 2231 | " \n", 2232 | " \n", 2233 | " \n", 2234 | " \n", 2235 | " \n", 2236 | " \n", 2237 | " \n", 2238 | " \n", 2239 | " \n", 2240 | " \n", 2241 | " \n", 2242 | " \n", 2243 | " \n", 2244 | " \n", 2245 | " \n", 2246 | " \n", 2247 | " \n", 2248 | " \n", 2249 | " \n", 2250 | "
book_id_titlebook_idbook_titlereview_urlreview_iddateratinguser_nameuser_urltextnum_likessort_ordershelves
0320.One_Hundred_Years_of_Solitude320One Hundred Years of Solitudehttps://www.goodreads.com/review/show/357268352335726835232020-10-164.0Gitte Hornung/user/show/63555571-gitte-hornungPhew this was a long book. At one point I cons...0newest[]
1320.One_Hundred_Years_of_Solitude320One Hundred Years of Solitudehttps://www.goodreads.com/review/show/359828443635982844362020-10-165.0Rob Jacobs/user/show/114599362-rob-jacobsGreat journey!0newest[]
2320.One_Hundred_Years_of_Solitude320One Hundred Years of Solitudehttps://www.goodreads.com/review/show/358295488935829548892020-10-162.0Rona Karen/user/show/6864201-rona-karenTwo stars for now. The repetitive names annoye...0newest[]
3320.One_Hundred_Years_of_Solitude320One Hundred Years of Solitudehttps://www.goodreads.com/review/show/212245241621224524162020-10-154.0Emma Pek/user/show/53126830-emma-pekThe story was timeless and full of excitement....0newest[]
4320.One_Hundred_Years_of_Solitude320One Hundred Years of Solitudehttps://www.goodreads.com/review/show/354126201035412620102020-10-154.0Irini Kallides/user/show/113080501-irini-kallidesAmazed about the richness of his language and ...0newest['book-club']
..........................................
44931934.Little_Women1934Little Womenhttps://www.goodreads.com/review/show/350892961135089296112020-09-144.0Michael/user/show/108824026-michaelThis was a great book despite how hard it was ...0newest[]
44941934.Little_Women1934Little Womenhttps://www.goodreads.com/review/show/348642611834864261182020-09-142.0Deanna/user/show/43177294-deannaWow that did not live up to the hype, but I be...0newest[]
44951934.Little_Women1934Little Womenhttps://www.goodreads.com/review/show/353266315435326631542020-09-142.0Kelly/user/show/8545345-kellyI listened to 'Little Women' as an audiobook a...0newest[]
44961934.Little_Women1934Little Womenhttps://www.goodreads.com/review/show/335960630133596063012020-09-142.0Ashley Brooks/user/show/17334972-ashley-brooksReading this as an adult was a different exper...0newest[]
44971934.Little_Women1934Little Womenhttps://www.goodreads.com/review/show/245944514024594451402020-09-144.0Khryzette Onishi/user/show/10999719-khryzette-onishiRating: 4.5 stars.A coming of age in its simpl...0newest[]
\n", 2251 | "

4498 rows × 13 columns

\n", 2252 | "
" 2253 | ], 2254 | "text/plain": [ 2255 | " book_id_title book_id \\\n", 2256 | "0 320.One_Hundred_Years_of_Solitude 320 \n", 2257 | "1 320.One_Hundred_Years_of_Solitude 320 \n", 2258 | "2 320.One_Hundred_Years_of_Solitude 320 \n", 2259 | "3 320.One_Hundred_Years_of_Solitude 320 \n", 2260 | "4 320.One_Hundred_Years_of_Solitude 320 \n", 2261 | "... ... ... \n", 2262 | "4493 1934.Little_Women 1934 \n", 2263 | "4494 1934.Little_Women 1934 \n", 2264 | "4495 1934.Little_Women 1934 \n", 2265 | "4496 1934.Little_Women 1934 \n", 2266 | "4497 1934.Little_Women 1934 \n", 2267 | "\n", 2268 | " book_title \\\n", 2269 | "0 One Hundred Years of Solitude \n", 2270 | "1 One Hundred Years of Solitude \n", 2271 | "2 One Hundred Years of Solitude \n", 2272 | "3 One Hundred Years of Solitude \n", 2273 | "4 One Hundred Years of Solitude \n", 2274 | "... ... \n", 2275 | "4493 Little Women \n", 2276 | "4494 Little Women \n", 2277 | "4495 Little Women \n", 2278 | "4496 Little Women \n", 2279 | "4497 Little Women \n", 2280 | "\n", 2281 | " review_url review_id \\\n", 2282 | "0 https://www.goodreads.com/review/show/3572683523 3572683523 \n", 2283 | "1 https://www.goodreads.com/review/show/3598284436 3598284436 \n", 2284 | "2 https://www.goodreads.com/review/show/3582954889 3582954889 \n", 2285 | "3 https://www.goodreads.com/review/show/2122452416 2122452416 \n", 2286 | "4 https://www.goodreads.com/review/show/3541262010 3541262010 \n", 2287 | "... ... ... \n", 2288 | "4493 https://www.goodreads.com/review/show/3508929611 3508929611 \n", 2289 | "4494 https://www.goodreads.com/review/show/3486426118 3486426118 \n", 2290 | "4495 https://www.goodreads.com/review/show/3532663154 3532663154 \n", 2291 | "4496 https://www.goodreads.com/review/show/3359606301 3359606301 \n", 2292 | "4497 https://www.goodreads.com/review/show/2459445140 2459445140 \n", 2293 | "\n", 2294 | " date rating user_name \\\n", 2295 | "0 2020-10-16 4.0 Gitte Hornung \n", 2296 | "1 2020-10-16 5.0 Rob Jacobs \n", 2297 | "2 2020-10-16 2.0 Rona Karen \n", 2298 | "3 2020-10-15 4.0 Emma Pek \n", 2299 | "4 2020-10-15 4.0 Irini Kallides \n", 2300 | "... ... ... ... \n", 2301 | "4493 2020-09-14 4.0 Michael \n", 2302 | "4494 2020-09-14 2.0 Deanna \n", 2303 | "4495 2020-09-14 2.0 Kelly \n", 2304 | "4496 2020-09-14 2.0 Ashley Brooks \n", 2305 | "4497 2020-09-14 4.0 Khryzette Onishi \n", 2306 | "\n", 2307 | " user_url \\\n", 2308 | "0 /user/show/63555571-gitte-hornung \n", 2309 | "1 /user/show/114599362-rob-jacobs \n", 2310 | "2 /user/show/6864201-rona-karen \n", 2311 | "3 /user/show/53126830-emma-pek \n", 2312 | "4 /user/show/113080501-irini-kallides \n", 2313 | "... ... \n", 2314 | "4493 /user/show/108824026-michael \n", 2315 | "4494 /user/show/43177294-deanna \n", 2316 | "4495 /user/show/8545345-kelly \n", 2317 | "4496 /user/show/17334972-ashley-brooks \n", 2318 | "4497 /user/show/10999719-khryzette-onishi \n", 2319 | "\n", 2320 | " text num_likes sort_order \\\n", 2321 | "0 Phew this was a long book. At one point I cons... 0 newest \n", 2322 | "1 Great journey! 0 newest \n", 2323 | "2 Two stars for now. The repetitive names annoye... 0 newest \n", 2324 | "3 The story was timeless and full of excitement.... 0 newest \n", 2325 | "4 Amazed about the richness of his language and ... 0 newest \n", 2326 | "... ... ... ... \n", 2327 | "4493 This was a great book despite how hard it was ... 0 newest \n", 2328 | "4494 Wow that did not live up to the hype, but I be... 0 newest \n", 2329 | "4495 I listened to 'Little Women' as an audiobook a... 0 newest \n", 2330 | "4496 Reading this as an adult was a different exper... 0 newest \n", 2331 | "4497 Rating: 4.5 stars.A coming of age in its simpl... 0 newest \n", 2332 | "\n", 2333 | " shelves \n", 2334 | "0 [] \n", 2335 | "1 [] \n", 2336 | "2 [] \n", 2337 | "3 [] \n", 2338 | "4 ['book-club'] \n", 2339 | "... ... \n", 2340 | "4493 [] \n", 2341 | "4494 [] \n", 2342 | "4495 [] \n", 2343 | "4496 [] \n", 2344 | "4497 [] \n", 2345 | "\n", 2346 | "[4498 rows x 13 columns]" 2347 | ] 2348 | }, 2349 | "execution_count": 11, 2350 | "metadata": {}, 2351 | "output_type": "execute_result" 2352 | } 2353 | ], 2354 | "source": [ 2355 | "newest_reviews " 2356 | ] 2357 | }, 2358 | { 2359 | "cell_type": "markdown", 2360 | "metadata": {}, 2361 | "source": [ 2362 | "How many Goodreads reviews did we collect for each book?" 2363 | ] 2364 | }, 2365 | { 2366 | "cell_type": "code", 2367 | "execution_count": 29, 2368 | "metadata": {}, 2369 | "outputs": [ 2370 | { 2371 | "data": { 2372 | "text/plain": [ 2373 | "To Kill a Mockingbird 300\n", 2374 | "The Great Gatsby 300\n", 2375 | "Wuthering Heights 300\n", 2376 | "One Hundred Years of Solitude 300\n", 2377 | "The Scarlet Letter 300\n", 2378 | "Narrative of the Life of Frederick Douglass 300\n", 2379 | "The Left Hand of Darkness 300\n", 2380 | "The Bluest Eye 300\n", 2381 | "Jane Eyre 300\n", 2382 | "Mrs. Dalloway 300\n", 2383 | "Little Women 300\n", 2384 | "The Handmaid's Tale 300\n", 2385 | "The Catcher in the Rye 300\n", 2386 | "The Iliad 299\n", 2387 | "Pride and Prejudice 299\n", 2388 | "Name: book_title, dtype: int64" 2389 | ] 2390 | }, 2391 | "execution_count": 29, 2392 | "metadata": {}, 2393 | "output_type": "execute_result" 2394 | } 2395 | ], 2396 | "source": [ 2397 | "newest_reviews['book_title'].value_counts()" 2398 | ] 2399 | }, 2400 | { 2401 | "cell_type": "markdown", 2402 | "metadata": {}, 2403 | "source": [ 2404 | "How many Goodreads reviews did we collect in total?" 2405 | ] 2406 | }, 2407 | { 2408 | "cell_type": "code", 2409 | "execution_count": 34, 2410 | "metadata": {}, 2411 | "outputs": [ 2412 | { 2413 | "data": { 2414 | "text/plain": [ 2415 | "4498" 2416 | ] 2417 | }, 2418 | "execution_count": 34, 2419 | "metadata": {}, 2420 | "output_type": "execute_result" 2421 | } 2422 | ], 2423 | "source": [ 2424 | "len(newest_reviews)" 2425 | ] 2426 | } 2427 | ], 2428 | "metadata": { 2429 | "kernelspec": { 2430 | "display_name": "Python 3", 2431 | "language": "python", 2432 | "name": "python3" 2433 | }, 2434 | "language_info": { 2435 | "codemirror_mode": { 2436 | "name": "ipython", 2437 | "version": 3 2438 | }, 2439 | "file_extension": ".py", 2440 | "mimetype": "text/x-python", 2441 | "name": "python", 2442 | "nbconvert_exporter": "python", 2443 | "pygments_lexer": "ipython3", 2444 | "version": "3.7.6" 2445 | } 2446 | }, 2447 | "nbformat": 4, 2448 | "nbformat_minor": 4 2449 | } 2450 | --------------------------------------------------------------------------------