简体   繁体   English

噩梦js控制台日志的东西

[英]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 我想要console.log .a-box-inner div的内容

How do I do this? 我该怎么做呢?

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

我应该把innerHTML

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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