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

Function escape_for_text_selector

playwright/_impl/_str_utils.py:54–59  ·  view source on GitHub ↗
(
    text: Union[str, Pattern[str]], exact: bool = None, case_sensitive: bool = None
)

Source from the content-addressed store, hash-verified

52
53
54def escape_for_text_selector(
55 text: Union[str, Pattern[str]], exact: bool = None, case_sensitive: bool = None
56) -> str:
57 if isinstance(text, Pattern):
58 return escape_regex_for_selector(text)
59 return json.dumps(text) + ("s" if exact else "i")
60
61
62def escape_for_attribute_selector(

Callers 3

__init__Method · 0.90
get_by_label_selectorFunction · 0.90
get_by_text_selectorFunction · 0.90

Calls 1

Tested by

no test coverage detected