Git Product home page Git Product logo

backstop-crawl's Introduction

$ backstop-crawl

Stories in Ready Build Status Coverage Status

backstop-crawl is a tool for automatically generating the backstop.json required for backstop by crawling a website.

Install

$ npm install --global backstop-crawl

Usage

โฏ backstop-crawl

  Crawl a site to generate a backstopjs config

  Usage
    $ backstop-crawl <url>

  Options
    --outfile, -o        Save the backstop config to this file
    --debug              Logs out errors produced while crawling
    --ignore-robots      Ignore the sites robots.txt
    --ignore-ssl-errors  Treat any certificate as valid (e.g. self-signed
                          or expired)
    --allow-subdomains   Allow crawling links found to subdomains of the
                          current domain
    --limit-similar[=3]  Limits the number of similar URLs to a set number
                         Defaults to 3
                          e.g /blog/1, /blog/2, /blog/3
    --reference-url  Allows a reference URL to be used in testing

  Examples
    $ backstop-crawl http://localhost
    $ backstop-crawl http://localhost --reference-url='https://mycoolsite.com'

backstop.template.json

You can customize the contents of the generated backstop.json file by creating a backstop.template.json file. In addition to standard items in backstop.json the backstop.template.json needs a defaultScenario key. This will be used when generating the scenarios for crawled URLs.

For example:

{
  "scenarios": [],
  "defaultScenario": {
  	"label": "Default",
  	"url": "",
  	"referenceUrl": "",
  	"hideSelectors": [],
  	"selectors": [
  	"document"
  	],
  	"readyEvent": null,
  	"delay": 1500,
  	"misMatchThreshold": 0.1
  }
}

License

MIT ยฉ fffunction fffunction.co

backstop-crawl's People

Contributors

ataylorme avatar danreeves avatar urlsangel avatar

Watchers

 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.