You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Access websites that actively block automation tools without using third-party captcha solving services. This native captcha handling makes Pydoll suitable for automating previously inaccessible websites.
211
211
212
+
## Multi-Tab Management
213
+
214
+
Pydoll provides sophisticated tab management capabilities with a singleton pattern that ensures efficient resource usage and prevents duplicate Tab instances for the same browser tab.
215
+
216
+
### Tab Singleton Pattern
217
+
218
+
Pydoll implements a singleton pattern for Tab instances based on the browser's target ID. This means:
219
+
220
+
-**One Tab instance per browser tab**: Multiple references to the same browser tab return the same Tab object
221
+
-**Automatic resource management**: No duplicate connections or handlers for the same tab
222
+
-**Consistent state**: All references to a tab share the same state and event handlers
223
+
224
+
```python
225
+
import asyncio
226
+
from pydoll.browser.chromium import Chrome
227
+
from pydoll.browser.tab import Tab
228
+
229
+
asyncdefsingleton_demonstration():
230
+
asyncwith Chrome() as browser:
231
+
tab =await browser.start()
232
+
233
+
# Get the same tab through different methods - they're identical objects
0 commit comments