Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
const puppeteer = require('puppeteer');
let page;
async function getBrowserPage() {
// Launch headless Chrome. Turn off sandbox so Chrome can run under root.
const browser = await puppeteer.launch({ args: ['--no-sandbox'] });
return browser.newPage();
exports.updateMoneyForward = async (req, res) => {
const url = "";
const mail = "メールアドレス";
const pw = "パスワード";
if (!page) {
page = await getBrowserPage();
await page.goto(url);
if((await page.title()) == 'ログイン|マネーフォワード ME'){
await page.focus('input[name="sign_in_session_service[email]"]');
await page.type('input[name="sign_in_session_service[email]"]',mail);
await page.focus('input[name="sign_in_session_service[password]"]');
await page.type('input[name="sign_in_session_service[password]"]',pw);
await page.waitFor(1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment