1
私はこのスクリプトを使ってquoraにログインしました。 quoraのNightmare.jsスクリプトが正しく動作しない
var Nightmare = require('nightmare');
var nightmare = Nightmare({ show: true });
nightmare
.goto('https://www.quora.com/')
.type('input[name="email"]','[email protected]')
.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のにはログインする必要があります。 しかし、私はこのスクリプトを実行すると、メールとパスワードの両方をメールフィールドに入力してエラーになります。