直接复用页面,避免CF验证

This commit is contained in:
2026-06-09 16:22:31 +08:00
parent 28fcc619a5
commit 2d75d21edc
3 changed files with 63 additions and 52 deletions
+5 -2
View File
@@ -64,9 +64,12 @@ class _FakeBrowserPool:
self.contexts.append(ctx)
return ctx
async def create_persistent_page(self, context: _FakeContext) -> _FakePage:
return _FakePage(self, context)
@asynccontextmanager
async def page_in_context(self, context: _FakeContext):
yield _FakePage(self, context)
async def navigation_slot(self):
yield
async def close_context(self, context: _FakeContext):
await context.close()