Skip to content

Commit

Permalink
update example
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarmorrison committed Jun 11, 2017
1 parent 3052262 commit d94089a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions index.js
@@ -1,16 +1,17 @@
const Nightmare = require('nightmare');
const nightmare = Nightmare({ show: false });

console.log('Welcome to Nightmare scrape\n==========\n');
const URL = 'http://blog.oscarmorrison.com/nightmarejs-on-heroku-the-ultimate-scraping-setup/';
console.log('Welcome to Nightmare scrape\n==========');

nightmare
.goto('https://www.chess.com/member/oscargem')
.wait('#sidebar')
.evaluate(() => document.querySelector('.user-rating').textContent)
.goto(URL)
.wait('.post-title')
.evaluate(() => document.querySelector('.post-title').textContent)
.end()
.then((result) => {
console.log(result);
console.log('all done\n=========\n');
console.log('=========\nAll done');
})
.catch((error) => {
console.error('an error has occurred: ' + error);
Expand Down

0 comments on commit d94089a

Please sign in to comment.