Last active
October 9, 2018 04:15
-
-
Save rainb3rry/e5680b2fef5f914da86060f6feeebe6c to your computer and use it in GitHub Desktop.
try registration with post request but site has a token control
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const request = require('request'); | |
const cheerio = require('cheerio'); | |
let register = 'https://www.n11.com/uye-ol' | |
request(register, function (error, response, body) { | |
const $ = cheerio.load(body); | |
let token = $('.birthDate').next().next().next().next().val(); | |
console.log(token); | |
request.post( | |
{ | |
url: register, | |
form: { | |
firstName: 'ahmet', | |
lastName: 'yilmaz', | |
email: '[email protected]', | |
password: 'nabersin1', | |
passwordAgain: 'nabersin1', | |
gender: 'M', | |
birthDay: 0, | |
birthMonth: 0, | |
birthYear: 0, | |
acceptContract: 'on', | |
token: token | |
} | |
}, | |
function(err, httpResponse, body) { | |
console.log(body); | |
} | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment