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 into gmail fails for some unknown reason #4577

Closed
Hretic opened this issue Jun 12, 2019 · 3 comments
Closed

login into gmail fails for some unknown reason #4577

Hretic opened this issue Jun 12, 2019 · 3 comments

Comments

@Hretic
Copy link

Hretic commented Jun 12, 2019

im trying to login into my gmail with puppeteer

here is my code


        await page.goto('https://accounts.google.com/AccountChooser?service=mail&continue=https://mail.google.com/mail/', {timeout: 60000})
            .catch(function (error) {
                throw new Error('TimeoutBrows');
            });

        await page.waitForSelector('#identifierId' , { visible: true });
        await page.type('#identifierId' , 'myemail');
        await Promise.all([
            page.click('#identifierNext') ,
            page.waitForSelector('.whsOnd' , { visible: true })
        ])
        await page.type('#password .whsOnd' ,  "mypassword");
        await page.click('#passwordNext');
        await  page.waitFor(5000);

but i always end up with this message in the picture below

https://i.stack.imgur.com/txZzA.png

i even tried to just open the login window with puppeteer and fill the login form manually myself ... but even that failed

am i missing something ?

when i look into console there is failed ajax request fired just after login

    Request URL: https://accounts.google.com/_/signin/challenge?hl=en&TL=APDPHBCG5lPol53JDSKUY2mO1RzSwOE3ZgC39xH0VCaq_WHrJXHS6LHyTJklSkxd&_reqid=464883&rt=j
    Request Method: POST
    Status Code: 401 
    Remote Address: 216.58.213.13:443
    Referrer Policy: no-referrer-when-downgrade
    

    )]}'
    
    [[["er",null,null,null,null,401,null,null,null,16]
    ,["e",2,null,null,81]
    ]]




@Hretic Hretic changed the title login in gmails fails for some unknown reason login in gmail fails for some unknown reason Jun 12, 2019
@Hretic Hretic changed the title login in gmail fails for some unknown reason login into gmail fails for some unknown reason Jun 12, 2019
@ryo-hisano
Copy link

Hi! @Hretic .

Well,
page.waitForSelector('.whsOnd' , { visible: true })
As for '.whsOnd' exists in two places,
page.waitForSelector('#password .whsOnd', { visible: true })
Should be

Also why
await page.click('#passwordNext');
If the problem does not work, there is a similar problem below,

Page.click() does not work with an input selector · Issue #3347 · GoogleChrome/puppeteer
#3347

await page.evaluate(() => {
    document.querySelector('#passwordNext').click();
});

Do you like

await page.waitFor(5000);
await page.click('#passwordNext');

It seems to work well by doing like.
Please give it a try.

@stale
Copy link

stale bot commented Jun 27, 2022

We're marking this issue as unconfirmed because it has not had recent activity and we weren't able to confirm it yet. It will be closed if no further activity occurs within the next 30 days.

@stale stale bot added the unconfirmed label Jun 27, 2022
@stale
Copy link

stale bot commented Jul 27, 2022

We are closing this issue. If the issue still persists in the latest version of Puppeteer, please reopen the issue and update the description. We will try our best to accomodate it!

@stale stale bot closed this as completed Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
@Hretic @ryo-hisano and others