From 9d605d5b5875decd8d60e0972ecd1af4108108a9 Mon Sep 17 00:00:00 2001 From: Mitsuki Ogasahara Date: Sun, 6 Feb 2022 05:36:43 +0900 Subject: [PATCH] Fix response to wait --- src/browser.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/browser.ts b/src/browser.ts index 1f6aa67..629b5b7 100644 --- a/src/browser.ts +++ b/src/browser.ts @@ -31,7 +31,8 @@ export class Browser { page.setViewportSize({ width: 1024, height: 360 }) await page.goto(url, { timeout: config.browserTimeout }) try { - await page.waitForResponse(/events/, { timeout: config.browserTimeout }) + const waitFor = url.includes('/query/') ? /results/ : /events/ + await page.waitForResponse(waitFor, { timeout: config.browserTimeout }) } catch { console.error() }