Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var page = require("webpage").create();
- page.open("http://vk.com")
- .then((status) => {
- if (status == "success") {
- page.onLoadFinished = function (status, url) {
- if (url.includes('vk.com/feed')) {
- console.log(page.evaluate(() => {
- return '{"cookie":"' + document.cookie + '"}';
- }));
- page.close();
- phantom.exit();
- }
- };
- page.evaluate(() => {
- const account = {
- login: 'your_login',
- password: 'your_password',
- };
- document.getElementById('index_email').value = account.login;
- document.getElementById('index_pass').value = account.password;
- document.getElementById('index_login_button').click();
- });
- }
- else {
- console.log("Sorry, the page is not loaded");
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement