Skip to content
Advertisement

How can I scrape all 1000 novels? ,my code scrapes only 691

url to scrape Genre

JavaScript

List for Genre in the Website

JavaScript

List for scraped Novels

JavaScript

For Loop to loop through navlist to append genre into the genre_list

JavaScript

For Loop to loop through the genre_list

JavaScript

for loop to loop each novel to get its title, cost, ratings

JavaScript

Loop to find novels of a particular rating

JavaScript

Writing these novels into my CSV file

JavaScript

Advertisement

Answer

Use for loop and provide the page number.Then use pandas dataframe to load data into dataframe and then do to_csv.

Code:

JavaScript

Output on console:

JavaScript

If you don’t want to hardcode final page count.Then try this.

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement