Javascript 如何使用Dream JS加载网页
我正在使用梦魇JS创建一个访问Facebook市场的网络机器人,并为我更新第一个列表。但是,当机器人运行时,只有导航栏加载,而身体的其余部分留空。我很好奇如何加载这个,否则我无法选择marketplace按钮 以下是我目前的代码:Javascript 如何使用Dream JS加载网页,javascript,node.js,nightmare,Javascript,Node.js,Nightmare,我正在使用梦魇JS创建一个访问Facebook市场的网络机器人,并为我更新第一个列表。但是,当机器人运行时,只有导航栏加载,而身体的其余部分留空。我很好奇如何加载这个,否则我无法选择marketplace按钮 以下是我目前的代码: const Nightmare = require('nightmare'); const nightmare = Nightmare({ show: true }); nightmare .viewport(1000, 1000) .goto('https:/
const Nightmare = require('nightmare');
const nightmare = Nightmare({ show: true });
nightmare
.viewport(1000, 1000)
.goto('https://www.facebook.com')
//type email in the email input #email
.insert('#email', 'EmailHere')
//type password in the password input #pass
.insert('#pass', 'PasswordHere')
//click the login button #loginbutton
.click('#loginbutton')
.wait(10000)
//click on marketplace button
.click('div.linkWrap.noCount:nth-of-type(3)')
//.click('div')
//.goto('https://www.facebook.com/marketplace/selling/')
.wait(5000)
.end()
.then(console.log('Nightmare has ended'))
.catch(error => {
console.error('Search failed:', error)
});