Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. var page = require("webpage").create();
  2. page.open("http://vk.com")
  3. .then((status) => {
  4. if (status == "success") {
  5.  
  6. page.onLoadFinished = function (status, url) {
  7. if (url.includes('vk.com/feed')) {
  8. console.log(page.evaluate(() => {
  9. return '{"cookie":"' + document.cookie + '"}';
  10. }));
  11.  
  12. page.close();
  13. phantom.exit();
  14. }
  15. };
  16.  
  17. page.evaluate(() => {
  18. const account = {
  19. login: 'your_login',
  20. password: 'your_password',
  21. };
  22.  
  23. document.getElementById('index_email').value = account.login;
  24. document.getElementById('index_pass').value = account.password;
  25. document.getElementById('index_login_button').click();
  26. });
  27. }
  28. else {
  29. console.log("Sorry, the page is not loaded");
  30. }
  31. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement