Code Monkey home page Code Monkey logo

scraper-books-toscrape.com's Introduction

scraper-books-toscrape.com

scraper for the website books.toscrape.com

Installation

pre-requisites

Concept Version
Docker 20.10
Git 2.37

install

  1. Clone this repository
git clone https://github.com/jxlil/scraper-books-toscrape.com.git
cd scraper-books-toscrape.com
  1. Deploy scraper with docker compose
docker compose up -d
  1. Check scraper status
curl http://0.0.0.0:3000/v1/scrape/
# expected output: {"status":"running"}

Use

Now you can run this scraper to get all the books in the categories:

To run the scraper you can do the following request:

curl --silent http://0.0.0.0:3000/v1/scrape/books

In the exports/ directory you will find a JSON and CSV file with the results.


You can also use jq and save the result in JSON format in any file

curl --silent http://0.0.0.0:3000/v1/scrape/books | jq . > books.json

example output:

{
  "book_count": 1,
  "categories": [
    "Biography",
  ],
  "books": [
    {
      "title": "The Rise of Theodore Roosevelt (Theodore Roosevelt #1)",
      "category": "Biography",
      "available_stock": 3,
      "price": 42.57,
      "num_stars": 3,
      "upc_code": "1a5044d233936b1a",
      "image_url": "http://books.toscrape.com/media/cache/4c/09/4c090b85892f532210e44d84b752b64d.jpg"
    }
  ]
}

scraper-books-toscrape.com's People

Contributors

jxlil avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.