Documentation suggests to do this when logging in:
await Promise.all([
page.waitForNavigation(), // The promise resolves after navigation has finished
page.click('a.my-link'), // Clicking the link will indirectly cause a navigation
]);
The second issue what I have is that it's not waiting for the selector and not clicking on it as well.
The element is probably not present on the page, or the target page is not what you expect it to be. Be sure to check with screenshots and/or headful mode.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…