我如何使pupeteer自动遵循重定向,就像浏览器处理重定向一样?
例如,如果我尝试在浏览器中加载网站https://www.aonhewitt.com
,它将自动重定向到https://www.aon.com/home/solutions/retirement.html
。但是,如果我尝试用pupeteer进行以下操作:
const pageResponse = await page.goto(url, {waitUntil: "domcontentloaded"});
出现错误,提示"Navigation timeout of 30000 ms exceeded"
。我该如何避免这个错误?