MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / connect_session

Method connect_session

py/private/cdp.py:434–442  ·  view source on GitHub ↗

Returns a new :class:`CdpSession` connected to the specified target.

(self, target_id)

Source from the content-addressed store, hash-verified

432 yield session
433
434 async def connect_session(self, target_id) -> "CdpSession":
435 """Returns a new :class:`CdpSession` connected to the specified target."""
436 global devtools
437 if devtools is None:
438 raise RuntimeError("CDP devtools module not loaded. Call import_devtools() first.")
439 session_id = await self.execute(devtools.target.attach_to_target(target_id, True))
440 session = CdpSession(self.ws, session_id, target_id)
441 self.sessions[session_id] = session
442 return session
443
444 async def _reader_task(self):
445 """Runs in the background and handles incoming messages.

Callers 1

open_sessionMethod · 0.95

Calls 2

CdpSessionClass · 0.85
executeMethod · 0.65

Tested by

no test coverage detected