简体   繁体   中英

nightmare js console log something

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?

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

我应该把innerHTML

  .evaluate(() => document.querySelector('.a-box-inner')).innerHTMl

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM