Hey. I am playing around with Puppeteer for Twitter automation. I have discovered that often the navigation will timeout. For example:
The page will just hang and I'll get the error
I have tried changing the
Has anyone else faced this problem? Is Twitter detecting me? Or have I missed something? I am using
thanks
Code:
puppeteer.launch({ headless: false }).then(async browser => {
try {
const page = await browser.newPage();
await page.goto('https://twitter.com/home');
// This sometimes fails with timeout error
await page.waitForNavigation({ waitUntil: 'networkidle2' });
if (page.url() === 'https://twitter.com/login') {
await login(page);
}
} catch(error) {
console.log(error);
}
});
The page will just hang and I'll get the error
TimeoutErrorI have tried changing the
waitUntil parameter and it doesn't seem to make a difference. I have also set await page.setDefaultNavigationTimeout(0); this of course stops the error appearing but the page just never responds.Has anyone else faced this problem? Is Twitter detecting me? Or have I missed something? I am using
puppeteer-extra with puppeteer-extra-plugin-stealth using the default settings.thanks