Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

login時にタイムアウトする #38

Open
i4M1k0SU opened this issue Dec 5, 2022 · 0 comments
Open

login時にタイムアウトする #38

i4M1k0SU opened this issue Dec 5, 2022 · 0 comments

Comments

@i4M1k0SU
Copy link
Member

i4M1k0SU commented Dec 5, 2022

TimeoutError: Navigation timeout of 30000 ms exceeded
    at /app/node_modules/puppeteer/src/common/LifecycleWatcher.ts:198:18
    at async FrameManager.waitForFrameNavigation (/app/node_modules/puppeteer/src/common/FrameManager.ts:211:19)
    at async Frame.waitForNavigation (/app/node_modules/puppeteer/src/common/FrameManager.ts:672:12)
    at async Page.waitForNavigation (/app/node_modules/puppeteer/src/common/Page.ts:1305:12)
    at async /app/node_modules/akashi-dakoku-core/lib/akashi-browser/index.js:25:5
    at async /app/node_modules/akashi-dakoku-core/lib/akashi-browser/index.js:37:5

エラー行をみると↓でタイムアウトしていた

const login = (page) => async (username, password, company) => {
    await page.goto('https://atnd.ak4.jp/login?next=%2Fmypage%2Fpunch', {
        waitUntil: 'domcontentloaded',
    });
    await page.type('#form_login_id', username);
    await page.type('#form_password', password);
    await page.type('#form_company_id', company);
    await page.click('input[type="submit"]');
    await page.waitForNavigation(); // ここでタイムアウト
    if (page.url() !== 'https://atnd.ak4.jp/mypage/punch') {
        throw new Error('ログインに失敗しました');
    }
};

調べてみるとこのような情報が出てきたが正しいのだろうか
https://www.meganii.com/blog/2020/01/30/puppeteer-wait-for-navigation/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant