Skip to content

Commit

Permalink
hi
Browse files Browse the repository at this point in the history
  • Loading branch information
rhyek committed Jun 13, 2024
1 parent d9e31a1 commit 65ecb7b
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions projects/scrape-txs/src/lib/bac-gt/scrape.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ export async function bacGtScrape({
const deleteTxIds: string[] = [];

await page.setExtraHTTPHeaders({
// 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:
'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',
'Accept-Language': 'en-US,en;q=0.9',
'Sec-Ch-Ua':
Expand All @@ -49,24 +49,21 @@ export async function bacGtScrape({
'Sec-Fetch-User': '?1',
'Upgrade-Insecure-Requests': '1',
});
await page.route(
/https:\/\/www.baccredomatic.com\/$/,
async (route, request) => {
if (request.resourceType() === 'document') {
const headers = Object.assign({}, route.request().headers(), {
// Host: 'www.baccredomatic.com',
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',
Connection: 'keep-alive',
});
console.log('hi from router handler!');
await route.continue({ headers });
} else {
await route.continue();
}
await page.route(/https:\/\/www.baccredomatic.com\/$/, async (route) => {
if (route.request().resourceType() === 'document') {
const headers = Object.assign({}, route.request().headers(), {
// Host: 'www.baccredomatic.com',
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',
Connection: 'keep-alive',
});
console.log('hi from router handler!');
await route.continue({ headers });
} else {
await route.continue();
}
);
});
await page.goto('https://www.baccredomatic.com/');
await waitRandomMs();
await page
Expand Down

0 comments on commit 65ecb7b

Please sign in to comment.