Skip to content

Commit 51f2432

Browse files
authored
fix: use initial cookies hook (#77)
* fix: use initial cookies hook * docs: update changelog
1 parent dee78cb commit 51f2432

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

code/src/crawler.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Dataset, NonRetryableError, PlaywrightCrawler, createRequestDebugInfo, log } from 'crawlee';
22

3+
import { initialCookiesHook } from './hooks/initial-cookies.js';
34
import { crawlRoute } from './routes/crawl-route.js';
45
import { Config } from './types/config.js';
56
import { CrawlerState } from './types/crawler-state.js';
@@ -26,6 +27,7 @@ export const createCrawler = async (config: Config) => {
2627
maxRequestsPerCrawl: maxPagesPerCrawl,
2728
requestHandler: crawlRoute,
2829
preNavigationHooks: [
30+
initialCookiesHook,
2931
async () => {
3032
const state = await crawler.useState<CrawlerState>();
3133
if (state.pagesOpened >= maxPagesPerCrawl) {

shared/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
This changelog tracks updates to both GTP Scraper and Extended GPT Scraper actors.
22

3+
# 2024-10-07
4+
*Fixes*
5+
- Fixed initial cookies not being set correctly from input.
6+
37
# 2024-09-22
48
*Fixes*
59
- Fixed a bug where HTML minimization was failing on some specific websites.

0 commit comments

Comments
 (0)