Giter Site home page Giter Site logo

armslist-scraper's Introduction

Armslist scraper

  • What is this?
  • [Assumptions] (#assumptions)
  • [Installation] (#installation)
  • [Run the project] (#run)
  • [What to expect] (#what-to-expect)

What is this?

Armslist is a tool for aggregating listings from Armslist.com, a site used as a marketplace for buying and selling guns.

Assumptions

The following things are assumed to be true in this documentation.

  • You are running OSX.
  • You are using Python 2.7. (Probably the version that came OSX.)
  • You have virtualenv and virtualenvwrapper installed and working.
  • You have GNU Parallel installed -- a shell tool to execute multiple commands from standard input simultaneously.

For more details on the technology stack used with the app-template, see our development environment blog post.

This code should work fine in most recent versions of Linux, but package installation and system dependencies may vary.

Installation

If you don’t already have GNU Parallel, get it like this:

brew install parallel

Then clone the project:

git clone [email protected]:nprapps/armslist.git
cd armslist

Run the project

Next, create a virtual environment and install the requirements:

mkvirtualenv armslist
pip install –r requirements.txt

Finally, run the script:

./scrape.sh

What to expect

The scraper will output the listings into a csv format.

Running script will make two main csv files as well as some extra files that may be handy for testing:

  • cache/index.csv is a master index of listings with the URL, state and date. This file is used to scrape each page individually.
  • cache/listings.csv is the bulk of the data. Each row represents a listing and the associated details.
  • cache/state/1/<statename> includes the log messages in a file called stderr and scraped index page data in a file called stdout on a per state basis.

The script could take a long time to run. We recommend using a fairly powerful Amazon EC2 instance in the Virginia/us-east-1 region to run the scraper.

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.