async def goForward( self, timeout: int = None, waitUntil: DocumentLoadState = None, ) -> Optional[Response]: return from_nullable_channel(await self._channel.send( "goForward", locals_to_params(locals())))
async def waitForSelector( self, selector: str, state: Literal["attached", "detached", "hidden", "visible"] = None, timeout: int = None, ) -> Optional["ElementHandle"]: return from_nullable_channel(await self._channel.send( "waitForSelector", locals_to_params(locals())))
async def goto( self, url: str, timeout: int = None, waitUntil: DocumentLoadState = None, referer: str = None, ) -> Optional[Response]: return cast( Optional[Response], from_nullable_channel(await self._channel.send( "goto", locals_to_params(locals()))), )
def __init__(self, parent: ChannelOwner, type: str, guid: str, initializer: Dict) -> None: super().__init__(parent, type, guid, initializer) self._redirected_from: Optional["Request"] = from_nullable_channel( initializer.get("redirectedFrom")) self._redirected_to: Optional["Request"] = None if self._redirected_from: self._redirected_from._redirected_to = self self._failure_text: Optional[str] = None self._timing: ResourceTiming = { "startTime": 0, "domainLookupStart": -1, "domainLookupEnd": -1, "connectStart": -1, "secureConnectionStart": -1, "connectEnd": -1, "requestStart": -1, "responseStart": -1, "responseEnd": -1, } self._headers: Dict[str, str] = parse_headers(self._initializer["headers"])
def __init__(self, parent: ChannelOwner, type: str, guid: str, initializer: Dict) -> None: super().__init__(parent, type, guid, initializer) self._parent_frame = from_nullable_channel( initializer.get("parentFrame")) if self._parent_frame: self._parent_frame._child_frames.append(self) self._name = initializer["name"] self._url = initializer["url"] self._detached = False self._child_frames: List[Frame] = [] self._page: "Page" self._load_states: Set[str] = set(initializer["loadStates"]) self._event_emitter = EventEmitter() self._channel.on( "loadstate", lambda params: self._on_load_state(params.get("add"), params.get("remove")), ) self._channel.on( "navigated", lambda params: self._on_frame_navigated(params), )
async def contentFrame(self) -> Optional["Frame"]: return from_nullable_channel(await self._channel.send("contentFrame"))
async def ownerFrame(self) -> Optional["Frame"]: return from_nullable_channel(await self._channel.send("ownerFrame"))
async def querySelector(self, selector: str) -> Optional["ElementHandle"]: return from_nullable_channel(await self._channel.send( "querySelector", dict(selector=selector)))
async def response(self) -> Optional["Response"]: return from_nullable_channel(await self._channel.send("response"))
async def opener(self) -> Optional["Page"]: return from_nullable_channel(await self._channel.send("opener"))