2018-06-24T13:24:05Z||2018-06-24T13:24:05Z


用了got:

npm install got --save

代码

const got = require('got');

(async () => {
  try {
    for (let i = 1; i <= 20; i++) {
      console.log(`Processing page ${i}`);
      const response = await got(`https://blabalabla.com/?page=${i}`);

      if (response.body.includes('GOLD')) {
        console.log('Found');
      }
    }
    } catch (error) {
        console.log('Error: ', error);
    }
})();

{ true}