Code Monkey home page Code Monkey logo

ebay-scraper's Introduction

Scraping from eBay

In this project, I created a Python program that scrapes information from eBay and saves it into either a JSON file or a CSV file. Here is a link to the project instructions: Project_03


The ebay-dl.py file contains this program. It utilizes the argparse, requests, and bs4 libraries to extract the name, price, ownership status, shipping cost, return cost, and units already sold for items that appear on eBay based on a specific search term, which is entered into the command line. The program then stores all of this information as a list of dictionaries, where each dictionary is for a different item. This list is saved as a JSON file by default when the program is executed.


In order to run the file, you should enter your search term into the command line. For example, the following command line was used to generate the ipad.json file:

$ python3 ebay-dl.py ipad

If your search term contains a space, you must put quotation marks around it. For example, the following command lines were used to generate the playstation 5.json file:

$ python3 ebay-dl.py 'playstation 5'

and the coffee maker.json file:

$ python3 ebay-dl.py 'coffee maker'


In order to save the output file as a CSV file instead of a JSON file, you would enter the --csv flag into the command line. For example, the following command lines were used to generate the lego.csv file:

$ python3 ebay-dl.py lego --csv

and the celsius energy drink.csv file:

$ python3 ebay-dl.py 'celsius energy drink' --csv


By default, the program scrapes information from the first 10 webpage results for your search term. This number can be adjusted in the command line. For example, if you wanted to scrape information from the first webpage only, you would enter:

$ python3 ebay-dl.py 'playstation 5' --num_pages=1

ebay-scraper's People

Contributors

kevinl0378 avatar

Stargazers

 avatar  avatar Adam avatar Ben Smith avatar Henry Long avatar  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.