Git Product home page Git Product logo

lazydriver's Introduction

Lazydriver

Lazydriver simplifies the building of a Chrome extension to scrape a site.

How it works

Different sites will have different logic, so you need to write a script to navigate the pages.

It is possible to parse the pages as you are navigating them, but I recommend simply saving the raw html and parsing it later. This gives you a wider choice of approaches/libraries/languages for parsing and allows.

Writing the script

Write your script to navigate the pages. Lazydriver includes jQuery automatically, so feel free to use it. Somewhere in that script, you need to run save_page to push the text to a couch. You may specify up to three options, pageId, text and couch. For any that you don't specify, these defaults will be used.

function save_page({
  pageId : document.URL
, text   : document.documentElement.innerHTML
, couch  : "http://localhost:5984/lazydriver"
},callback)

In addition to writing a script to navigate the page, you need to write a manifest.json.

Building

Once you've finished the script and manifest.json, run build.sh <chrome extension dir>, and an unpacked chrome extension will appear in a deploy directory inside the chrome extension directory.

Then you can go to the chrome extensions panel to load the extension or pack it.

lazydriver's People

Contributors

tlevine avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

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