Giter Site home page Giter Site logo

dww-scraper's Introduction

DWW-Scraper Quick Guide

This is a brief explanation of how the drinking water watch (DWW) scraper script works. The application is currently split up into three jupyter notebooks to be run in the following order. They scrape lab samples stored in HTML tables on subpages captured in the DWW non-coliform samples search. The samples are stored in a bunch of small .pkl files, then stitched together into one large dataframe.

1. DWW_Scraper.ipynb:

This is the main web scraping script. It takes a long time to run (i.e. a few days running continuously to get through 5 years of statewide data). This opens up the URL of the DWW non-coliform samples search results page, clicks on all of the links on the page, then stores data from the tables on each of the lab samples pages in a pandas dataframe. It iterates through each county and year individually to break up the scraping into small chunks, so you don't lose all your progress when it breaks. Each of these chunks is stored in .pkl files.

To adapt this to another state's DWW site, I think you will just need to change the url within the run_script() function and create an appropriate list of counties.

2. Load pickles into dww dataframe.ipynb

The .pkl files from the previous step are stitched together into one large .pkl file.

3. DWW Data Cleaning.ipynb:

This removes extra characters from the data and saves it as a .csv file. Concentration measure and units are split into two separate columns.

dww-scraper's People

Contributors

dependabot[bot] avatar ricerb 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.