MCPcopy Create free account
hub / github.com/microsoft/playwright-python / nodelike_urlparse

Function nodelike_urlparse

playwright/_impl/_helper.py:268–279  ·  view source on GitHub ↗
(url: str)

Source from the content-addressed store, hash-verified

266
267
268def nodelike_urlparse(url: str) -> ParseResult:
269 parsed = urlparse(url, allow_fragments=True)
270
271 # https://url.spec.whatwg.org/#special-scheme
272 is_special_url = parsed.scheme in ["http", "https", "ws", "wss", "ftp", "file"]
273 if is_special_url:
274 # special urls have a list path, list paths are serialized as follows: https://url.spec.whatwg.org/#url-path-serializer
275 # urllib diverges, so we patch it here
276 if parsed.path == "":
277 parsed = parsed._replace(path="/")
278
279 return parsed
280
281
282class HarLookupResult(TypedDict, total=False):

Callers 1

resolve_base_urlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected