Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pintu544/assignmentpartb

Scrape books data from http://books.toscrape.com and store it in Database.
https://github.com/pintu544/assignmentpartb

Last synced: 6 days ago
JSON representation

Scrape books data from http://books.toscrape.com and store it in Database.

Awesome Lists containing this project

README

        

```markdown
# Book Scraper and Database Storer

## Overview

This project is a web scraper that collects book data from [http://books.toscrape.com](http://books.toscrape.com) and stores it in an SQLite database. It scrapes book attributes like name, price, availability, and ratings from all 50 pages of the website.

## Prerequisites

Before running the application, make sure you have the following installed:

- Node.js: [https://nodejs.org/](https://nodejs.org/)
- npm (Node Package Manager): Included with Node.js installation

## Getting Started

1. Clone this repository to your local machine:

```bash
git clone [](https://github.com/pintu544/AssignmentPartB)
```

2. Navigate to the project directory:

```bash
cd server
```

3. Install project dependencies:

```bash
npm install
```

4. Create the SQLite database by running the database setup script:

```bash
node /db/db.js
```

## Usage

To scrape book data and store it in the database, run the main script:

```bash
node index.js
```

The script will initiate the scraping process for all 50 pages of books from [http://books.toscrape.com](http://books.toscrape.com). The scraped data will be stored in the `books.db` SQLite database.

## Database Structure

The SQLite database (`books.db`) contains two tables:

1. `books`: Stores book data including title, price, availability, and rating.
2. `sqlite_sequence`: Automatically generated by SQLite to keep track of table row counts.

## Contributing

Contributions to this project are welcome. Feel free to open issues and pull requests.

## License

This project is licensed under the [MIT License](LICENSE).

## Acknowledgments

- This project uses [axios](https://axios-http.com/) for making HTTP requests.
- Web scraping is done using [cheerio](https://cheerio.js.org/) for parsing HTML.
- Data is stored in an SQLite database using the [sqlite3](https://github.com/sqlitejs/sqlite3) library.

## Contact

For questions or inquiries, contact [Pintu Kumar](mailto:[email protected]).
```

Replace `` with the URL of your project's Git repository. Customize the content under each section (Overview, Prerequisites, Getting Started, Usage, Database Structure, Contributing, License, Acknowledgments, Contact) to provide relevant information about your project.

The README.md file serves as documentation for your project, making it easier for others (and yourself) to understand, use, and contribute to your code.