Library which helps you to scrape data from react sites easily.
Using npm:
$ npm i --save nightmare-react-utils
const Nightmare = require('nightmare')
const Actions = require('nightmare-react-utils').Actions
Nightmare.action(...Actions)
Nightmare()
.goto('http://your-react-site.com')
.react.findAll('.item')
.then(function(items) {
//... do something with items values
})
All actions are in .react namespace
Check if exists react element with selector.
Returns boolean
.
Finds react elements and take his state, props and context.
Returns objects with {state, props, context}
Finds react elements and take their state, props and context.
Returns array of objects {state, props, context}
Waits for react element.
Usage:
nightmare
.react.wait('.react-element')
.react.wait('.react-element', (values) => values.state.loaded)
.react.wait('.react-element', 'state.name', 'Something')
.react.wait('.react-element', 500)
.then(function() {
//... do something ...
})