CodeceptJS
CodeceptJS copied to clipboard
TimeoutError: Timeout exceeded while waiting for event
I use puppeteer to scrap info from one page, and i want to get href value which appears only when you hover over element, if you dont hover -> href="#". So i hover over element and take href="info that i need"
sometimes when i hover on element, that href doesn't change instantly because request need to be done, i tried to use page.waitForNetworkIdle() but that sometimes doesn't work, so i tried to use page.waitForResponse() but sometimes it gives error: "TimeoutError: Timeout exceeded while waiting for event", but response comes when i look to network tab in chrome and after it comes, function timeouts somehow. so it doesn't capture response somehow.
and after long scroling, i got error: "Node is either not clickable or not an HTMLElement" when i try to hover over it.
Code
private async hover(post: ElementHandle) {
const link = await post.$(selectors.facebook_post.post_link);
await link?.hover();
await this.page.waitForResponse(
(response) =>
response.url() ===
"https://www.facebook.com/ajax/bulk-route-definitions/" &&
response.status() === 200
);
}
Details
- NodeJS Version: v10.19.0
- Operating System: Ubuntu 20.04
- puppeteer version: ^11.0.0