Code Monkey home page Code Monkey logo

hisnibsscraper's Introduction

HisNibsScraper

This repository contains the Python code used to scrape the product listings from HisNibs.com, insert them into a MongoDB collection, which will then be used to build a proposed redesign of the site.

Setup

In order for this webscraper to function properly, you must download the version of chromedriver that matches your version of Google Chrome, and place it at the root-level of this directory. chromedriver can be dowloaded here

Approach

The general plan for this project is to:

  1. Gather the URLs of each brand's product pages
  2. Determine keywords that can be used to differentiate actual product listings from the rest of the page's content (very few selectors used on original site, so we are forced to use text/Regex-based keywords)
  3. Begin scraping
    1. For each brand/URL pairing ...
    2. Use BeautifulSoup to extract elements that contain one of the keywords
    3. Filter the list of found elements by those that contain a "$" (price) in their text
    4. Map each of the filtered elements' text to Pen objects using Regular Expressions, focusing on Name, Price, and whether or not the product is SoldOut
    5. Add the brand and srcURL (where the pen was found on the current site) attributes to each Pen object found on this page, using the known values from the enclosing loop
    6. Append each of the new Pen objects to a master list
  4. Insert each of the Pens in the master list (see step 3vi) into a MongoDB Collection

hisnibsscraper's People

Contributors

bweir27 avatar

Watchers

James Cloos avatar  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.