Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Nightmare = require('nightmare');
- (async () => {
- let nightmare;
- try {
- nightmare = Nightmare({ show: true });
- let a = nightmare.goto('http://127.0.0.1:8000')
- .wait()
- .type('#inputEmail', '222@mail.ru')
- .type('#inputPassword', '123456')
- .click('#button_c')
- .wait(3000)
- .goto('http://127.0.0.1:8000/q/7')
- .wait(3000)
- items.forEach((item) => {
- a.type('#answer_answer', '').type('#answer_answer', item['id']).click('#next_b').wait(3000);
- })
- } catch (error) {
- console.error(error);
- throw error;
- } finally {
- await nightmare.end();
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement