1

I have this code:

nightmare
  .goto('https://xxxdsfdx.com')
  .type('#ap_email', 'mail@gmail.com')
  .type('#ap_password', 'passsword')
  .click('#signInSubmit')
  .wait('#report-wrapper')
  .click('.a-tab-heading:nth-child(7)')
  .evaluate(() => document.querySelector('.a-box-inner'))
  .then(console.log)
  .catch((error) => {
    console.error('failed:', error);
  });

I want to console.log contents of .a-box-inner div

How do I do this?

user2950593
  • 9,233
  • 15
  • 67
  • 131

2 Answers2

1

.then(console.log.bind(console))

Peter
  • 1,742
  • 15
  • 26
1

I should put innerHTML

  .evaluate(() => document.querySelector('.a-box-inner')).innerHTMl
user2950593
  • 9,233
  • 15
  • 67
  • 131