-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
microsoft/playwright
#6511Description
Test on Chrome Version 90.0.4430.212 (Official Build) (64-bit) (Windows 10 20H2 OS Build 19042.928)
chrome lunched with "--remote-debugging-port=9222"
code:
##########
from playwright.sync_api import sync_playwright
playwright = sync_playwright().start()
chrome = playwright.chromium.connect_over_cdp("http://localhost:9222")
c1 = chrome.contexts[0] # default context
print(c1.pages) # []
print(len(c1.pages)) # 0
##########
but i am able to get all the opened pages after i open a new_page:
##########
from playwright.sync_api import sync_playwright
playwright = sync_playwright().start()
chrome = playwright.chromium.connect_over_cdp("http://localhost:9222")
c1 = chrome.contexts[0]
c1.new_page()
print(c1.pages)
print(len(c1.pages)) # 6 (5 opened pages + the new page)
##########
OxNinja