@feizheng/sso-juejin
v1.0.0
Published
Sso for juejin site.
Downloads
5
Readme
sso-juejin
Sso for juejin site.
installation
npm install -S @feizheng/sso-juejin
usage
import ssoJuejin from '@feizheng/sso-juejin';
ssoJuejin({ username: 'YOUR_USERNAME', password: '-----', headless: false }).then(
(res) => {
console.log(res);
}
);
example
const puppeteer = require("puppeteer");
const main = async () => {
const browser = await puppeteer.launch({ headless: false });
const page = await browser.newPage();
await page.goto("https://juejin.im/");
page.click(".login");
await page.waitForSelector(".auth-modal-box");
await page.type("[name=loginPhoneOrEmail]", "[email protected]", { delay: 100 });
await page.type("[name=loginPassword]", "----", { delay: 100 });
await page.click(".auth-modal-box .btn");
return page.cookies();
};
main().then(res => {
console.log(res);
});