Closed elacuesta closed 3 years ago
That would be nice!
I'm trying to control a number of context and a number of pages per context.
The motivation of this is that I need to make some requests with single IP, but after that I need to change it. I'm using https://github.com/mattes/rotating-proxy as rotating proxy.
I have modified middleware to do that and now I can set the maximum number of context using PLAYWRIGHT_MAX_CONTEXTS
and the maximum number of pages per context using PLAYWRIGHT_MAX_PAGES_PER_CONTEXT
. After setting context
...
"PLAYWRIGHT_CONTEXT_ARGS": {
"proxy": {
"server": "127.0.0.1:5566",
},
},
each context has its own IP.
fork, middleware, usage example
It would be good to have a way to manage multiple browsers contexts, either defined at the start of the crawl (in settings, for instance) or created/destroyed during the crawl.
/cc @kalessin