MCPcopy Index your code
hub / github.com/microsoft/playwright-python / start_har

Method start_har

playwright/_impl/_tracing.py:170–190  ·  view source on GitHub ↗
(
        self,
        path: Union[pathlib.Path, str],
        content: Literal["attach", "embed", "omit"] = None,
        mode: Literal["full", "minimal"] = None,
        urlFilter: Union[str, Pattern[str]] = None,
    )

Source from the content-addressed store, hash-verified

168 )
169
170 async def start_har(
171 self,
172 path: Union[pathlib.Path, str],
173 content: Literal["attach", "embed", "omit"] = None,
174 mode: Literal["full", "minimal"] = None,
175 urlFilter: Union[str, Pattern[str]] = None,
176 ) -> DisposableStub:
177 if self._har_id:
178 raise Error("HAR recording has already been started")
179 is_zip = str(path).endswith(".zip")
180 default_content: Literal["attach", "embed", "omit"] = (
181 "attach" if is_zip else "embed"
182 )
183 self._har_id = await self._record_into_har(
184 har=path,
185 page=None,
186 url=urlFilter,
187 update_content=content or default_content,
188 update_mode=mode or "full",
189 )
190 return DisposableStub(lambda: self.stop_har(), self)
191
192 async def _record_into_har(
193 self,

Calls 4

_record_into_harMethod · 0.95
stop_harMethod · 0.95
DisposableStubClass · 0.90
ErrorClass · 0.85