Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. var Nightmare = require('nightmare');
  2. (async () => {
  3. let nightmare;
  4. try {
  5. nightmare = Nightmare({ show: true });
  6. let a = nightmare.goto('http://127.0.0.1:8000')
  7. .wait()
  8. .type('#inputEmail', '222@mail.ru')
  9. .type('#inputPassword', '123456')
  10. .click('#button_c')
  11. .wait(3000)
  12. .goto('http://127.0.0.1:8000/q/7')
  13. .wait(3000)
  14. items.forEach((item) => {
  15. a.type('#answer_answer', '').type('#answer_answer', item['id']).click('#next_b').wait(3000);
  16. })
  17.  
  18. } catch (error) {
  19. console.error(error);
  20. throw error;
  21. } finally {
  22. await nightmare.end();
  23. }
  24. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement