Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

node.js sign in to website and get contents of new page

var request = require('request');
var request = request.defaults({jar: true});

var loginPage = "https://login.wordpress.org/wp-login.php";
request.post(
    loginPage,
    {"log": "example28574", "pwd": "password28574", "wp-submit": "Log In", "redirect_to": "https://login.wordpress.org/"},
    function (error, response, body) {
        console.log(1);
        if (!error && response.statusCode == 200) {
            console.log(body);
        }
        if(error) console.log(error);
        if(response.statusCode != 200) console.log(response.statusCode);
    }
);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sign #website #contents #page
ADD COMMENT
Topic
Name
4+2 =