Well, I found a solution for this!
With these settings I saw many "Target page, context or browser has been closed" errors:
browserPoolOptions: {
operationTimeoutSecs: 40,
retireBrowserAfterPageCount: 3,
maxOpenPagesPerBrowser: 3,
closeInactiveBrowserAfterSecs: 30,
Than I changed a few settings... and no errors any more:
browserPoolOptions: {
operationTimeoutSecs: 30,
retireBrowserAfterPageCount: 2,
maxOpenPagesPerBrowser: 10,
closeInactiveBrowserAfterSecs: 200,
Probably the low value of
closeInactiveBrowserAfterSecs
(30) caused these errors, but I am not sure.
The very low value of
retireBrowserAfterPageCount
is needed to change browser fingerprint often: my goal is to have
unique fingerprints per request. With
retireBrowserAfterPageCount=2
I have unique fingerprint every two requests, which isn't perfect, but it's not bad.
By the way, we discussed this "New fingerprint per new page in browser-pool" thing in the past (and still no good solution for use with PlaywrightCrawler as far as I understand... but this should be discussed separately):
https://discord.com/channels/801163717915574323/1060467542616965150/1062991696813625405