Skip to main content

A small eBay web scraper package

Project description

eBay Web Scraper

Description

This is a web scraper that extracts info about listings from popular e-commerce site, eBay. Collects info about the category the listing belongs to, title of listing, link to the listing, link to the listing's image and price of each listing.

Technologies

Getting Started

Using this scraper is very simple, all you need is to have Git and Docker Engine installed on your machine. If you do not wish to use docker, simply create your own virtual environment and run pip install -r requirements.txt from the root directory to install the requirements stated in the requirements.txt file Don't forget to add your postgres database connection variables in the .env file in the root folder. Example of what the .env file should look like

DB_PORT = XXXX
DB_HOST = your_database_host
DB_USER = your_username
DB_NAME = the_name_of_your_database_here
DB_PASSWORD = your_password_here

The scraper can be found in src/scraper eBay contains 3 methods which are scrape(), add_category_to_database(), add_listing_to_database(). The methods are self-explanatory. scrape takes in the category/keyword, and the number/quantity of listings to be scraped while add_category_to_database() and add_listing_to_database() adds categories and listings to their respective databases.

Example:

    from src.scraper import eBay
    ebay = eBay()
    ebay.scrape(keyword="book", quantity=200)
    ebay.add_category_to_database()
    ebay.add_listings_to_database()

Testing

This project has pytest embedded in it and can be run with the following command python -m pytest tests/ from the root directory. Note: This should be run after after all necessary database connection variables have been declared in the.env file

License

The MIT License - Copyright (c) 2021 - Rafihatu Bello

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scraper-Rafihatu-0.0.3.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scraper_Rafihatu-0.0.3-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file scraper-Rafihatu-0.0.3.tar.gz.

File metadata

  • Download URL: scraper-Rafihatu-0.0.3.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for scraper-Rafihatu-0.0.3.tar.gz
Algorithm Hash digest
SHA256 4ff16f60268fdf0ede9c48bd96b407d7b21c5fb73cb1db472b1f45883d521ae6
MD5 b06e624cca53a08ae52cfeded5aa8049
BLAKE2b-256 bdf4f3081590364b2cd7ec4dceb13ec43640f58ddb924fe48072cde090a8f417

See more details on using hashes here.

File details

Details for the file scraper_Rafihatu-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: scraper_Rafihatu-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for scraper_Rafihatu-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0f603da71a147ca84ffafffc8e0923b094f076c45dd0a6c9261e2754a05f0cb5
MD5 6c9de559c810335dc2ff706073acc45e
BLAKE2b-256 cee9d83dcd569f3c8b5bc3052852a3aaf3a65b959288af891dc8fd0f89724432

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page