From f719a521920f53ee4de7f1873d2967c84b669ade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Gonz=C3=A1lez?= Date: Wed, 12 Jun 2024 17:20:58 -0600 Subject: [PATCH] route again --- projects/scrape-txs/src/lib/bac-gt/scrape.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/projects/scrape-txs/src/lib/bac-gt/scrape.ts b/projects/scrape-txs/src/lib/bac-gt/scrape.ts index a4b4e62..a1c32db 100644 --- a/projects/scrape-txs/src/lib/bac-gt/scrape.ts +++ b/projects/scrape-txs/src/lib/bac-gt/scrape.ts @@ -49,14 +49,15 @@ export async function bacGtScrape({ 'Sec-Fetch-User': '?1', 'Upgrade-Insecure-Requests': '1', }); - // await page.route('https://www.baccredomatic.com/', async (route) => { - // const headers = Object.assign({}, route.request().headers(), { - // Accept: - // 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7', - // 'Accept-Encoding': 'gzip, deflate, br, zstd', - // }); - // await route.continue({ headers }); - // }); + await page.route('https://www.baccredomatic.com/', async (route) => { + const headers = Object.assign({}, route.request().headers(), { + Accept: + 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7', + 'Accept-Encoding': 'gzip, deflate, br, zstd', + }); + console.log('hi from router handler!'); + await route.continue({ headers }); + }); await page.goto('https://www.baccredomatic.com/'); await waitRandomMs(); await page