gpt4 book ai didi

javascript - quora 上的 Nightmare.js 脚本无法正常工作

转载 作者:行者123 更新时间:2023-11-30 20:56:16 26 4
gpt4 key购买 nike

我写了这个脚本来登录法定人数。

var Nightmare = require('nightmare');   
var nightmare = Nightmare({ show: true });

nightmare
.goto('https://www.quora.com/')
.type('input[name="email"]','xyz@gmail.com')
.type('input[type="password"]','pass123')
.click('input[type="submit"]')
.wait(5000)
.click('.disable_click_on_edit_mode')
.wait(5000)
.evaluate(function () {
return document.querySelectorAll('.question_link').href;
})
.end()
.then(function (result) {
console.log(result);
})
.catch(function (error) {
console.error('Error message:', error);
});

通过在电子邮件字段中输入我的电子邮件并在我的密码字段中输入我的密码,然后单击登录按钮,它应该可以轻松登录到 quora。但是当我运行这个脚本时,它会在电子邮件字段中输入电子邮件和密码,然后导致错误。

最佳答案

好的,我尝试并找到了另一个有效的解决方案。由于该登录页面只有两个输入框,您可以使用:

nightmare
.goto('https://www.quora.com/')
.type('input[tabindex="1"]','xyz@gmail.com')
.type('input[tabindex="2"]','pass123')
.click('input[type="submit"]')
.wait(5000)
.click('.disable_click_on_edit_mode')
.wait(5000)
.evaluate(function () {
return document.querySelectorAll('.question_link').href;
})

关于javascript - quora 上的 Nightmare.js 脚本无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47630056/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com