MCPcopy Create free account

hub / github.com/scrapy/parsel / functions

Functions186 in github.com/scrapy/parsel

↓ 180 callersMethodxpath
Find nodes matching the xpath ``query`` and return the result as a :class:`SelectorList` instance with all elements flattened. List
parsel/selector.py:562
↓ 59 callersMethodcss
Apply the given CSS selector and return a :class:`SelectorList` instance. ``query`` is a string containing the CSS selector to apply
parsel/selector.py:625
↓ 23 callersMethodre
Apply the given regex and return a list of strings with the matches. ``regex`` can be either a compiled regular expression o
parsel/selector.py:644
↓ 22 callersMethodget
Serialize and return the matched nodes. For HTML and XML, the result is always a string, and percent-encoded content is unqu
parsel/selector.py:699
↓ 20 callersMethodgetall
Serialize and return the matched node in a 1-element list of strings.
parsel/selector.py:724
↓ 16 callersMethodre_first
( self, regex: str | Pattern[str], default: None = None, replace_entities: boo
parsel/selector.py:661
↓ 15 callersMethodjmespath
Find objects matching the JMESPath ``query`` and return the result as a :class:`SelectorList` instance with all elements flattened. L
parsel/selector.py:520
↓ 12 callersMethodx
(self, *a: Any, **kw: Any)
tests/test_selector_csstranslator.py:175
↓ 10 callersMethoddrop
Drop matched nodes from the parent element.
parsel/selector.py:757
↓ 9 callersMethodassertIsSelectorList
(self, value: Any)
tests/test_selector.py:34
↓ 6 callersMethodc2x
(self, css: str)
tests/test_selector_csstranslator.py:61
↓ 6 callersFunctionflatten
flatten(sequence) -> list Returns a single, flat list which contains all elements retrieved from the sequence and all recursively contained su
parsel/utils.py:12
↓ 6 callersMethodregister_namespace
Register the given namespace to be used in this :class:`Selector`. Without registering namespaces you can't select or extract data fr
parsel/selector.py:730
↓ 5 callersFunction_xml_or_html
(type_: str | None)
parsel/selector.py:86
↓ 4 callersMethodcss_to_xpath
(self, css: str, prefix: str = "descendant-or-self::")
parsel/csstranslator.py:137
↓ 4 callersMethodmy_own_func
(self)
tests/typing/selector.py:21
↓ 4 callersMethodremove_namespaces
Remove all namespaces, allowing to traverse the document using namespace-less xpaths. See :ref:`removing-namespaces`. For JSO
parsel/selector.py:738
↓ 3 callersFunctioncreate_root_node
Create root node for text using given parser class.
parsel/selector.py:90
↓ 3 callersMethodfrom_xpath
( cls, xpath: OriginalXPathExpr, textnode: bool = False, attribute: str | None
parsel/csstranslator.py:22
↓ 3 callersFunctioniflatten
iflatten(sequence) -> Iterator Similar to ``.flatten()``, but returns iterator instead Examples: >>> list(iflatten([[1, 2], (3, 4)]))
parsel/utils.py:30
↓ 3 callersFunctionset_xpathfunc
Register a custom extension function to use in XPath expressions. The function ``func`` registered under ``fname`` identifier will be called
parsel/xpathfuncs.py:16
↓ 3 callersFunctionshorten
Truncate the given text to fit in the given width.
parsel/utils.py:97
↓ 2 callersFunction_load_json_or_none
(text: str)
parsel/selector.py:371
↓ 2 callersMethodassertIsSelector
(self, value: Any)
tests/test_selector.py:31
↓ 2 callersFunctionextract_regex
Extract a list of strings from the given text/encoding using the following policies: * if the regex contains a named group called "extract" that w
parsel/utils.py:68
↓ 1 callersMethod__init__
( self, text: str | None = None, type: str | None = None, # noqa: A002 body:
parsel/selector.py:431
↓ 1 callersMethod_css2xpath
(self, query: str)
parsel/selector.py:640
↓ 1 callersMethod_get_root
( self, text: str = "", base_url: str | None = None, huge_tree: bool = LXML_SU
parsel/selector.py:502
↓ 1 callersFunction_get_root_and_type_from_bytes
( body: bytes, encoding: str, *, input_type: str | None, **lxml_kwargs: Any, )
parsel/selector.py:301
↓ 1 callersFunction_get_root_and_type_from_text
( text: str, *, input_type: str | None, **lxml_kwargs: Any )
parsel/selector.py:331
↓ 1 callersFunction_get_root_from_text
(text: str, *, type_: str, **lxml_kwargs: Any)
parsel/selector.py:297
↓ 1 callersFunction_get_root_type
(root: Any, *, input_type: str | None)
parsel/selector.py:350
↓ 1 callersFunction_is_listlike
>>> _is_listlike("foo") False >>> _is_listlike(5) False >>> _is_listlike(b"foo") False >>> _is_listlike([b"foo"]) Tru
parsel/utils.py:44
↓ 1 callersFunction_is_valid_json
(text: str)
parsel/selector.py:363
↓ 1 callersFunction_load
(attack: str)
tests/test_xml_attacks.py:12
↓ 1 callersFunctioncss2xpath
Return translated XPath version of a given CSS query
parsel/csstranslator.py:144
↓ 1 callersMethodextra_method
(self)
tests/test_selector.py:865
↓ 1 callersMethodtr_cls
(self)
tests/test_selector_csstranslator.py:58
Method__bool__
Return ``True`` if there is any real content selected or ``False`` otherwise. In other words, the boolean value of a :class:`Selecto
parsel/selector.py:797
Method__getitem__
(self, pos: SupportsIndex)
parsel/selector.py:129
Method__getstate__
(self)
parsel/selector.py:144
Method__getstate__
(self)
parsel/selector.py:499
Method__init__
(self, *args: Any, **kwargs: Any)
parsel/selector.py:61
Method__init__
( self, text: str | None = None, type: str | None = None, # noqa: A002 body:
tests/test_selector.py:1220
Method__repr__
(self)
parsel/selector.py:810
Method__str__
(self)
parsel/selector.py:807
Method__str__
(self)
parsel/csstranslator.py:33
Methodattrib
Return the attributes dictionary for the first element. If the list is empty, return an empty dict.
parsel/selector.py:278
Methodattrib
Return the attributes dictionary for underlying element. For JSON selectors, return an empty dict.
parsel/selector.py:787
Functioncorrect
()
tests/typing/selector.py:9
Methodcss
Call the ``.css()`` method for each element in this list and return their results flattened as another :class:`SelectorList`.
parsel/selector.py:187
Methodcss_to_xpath
(self, css: str, prefix: str = ...)
parsel/csstranslator.py:73
Methodcss_to_xpath
(self, css: str, prefix: str = "descendant-or-self::")
parsel/csstranslator.py:131
Methoddrop
Drop matched nodes from the parent for each element in this list.
parsel/selector.py:286
Methodget
(self, default: None = None)
parsel/selector.py:259
Methodgetall
Call the ``.get()`` method for each element is this list and return their results flattened, as a list of strings.
parsel/selector.py:249
Functionhas_class
has-class function. Return True if all ``classes`` are present in element's class attr.
parsel/xpathfuncs.py:41
Functionincorrect
()
tests/typing/selector.py:33
Methodjmespath
Call the ``.jmespath()`` method for each element in this list and return their results flattened as another :class:`SelectorList`.
parsel/selector.py:147
Methodjoin
( self: Self, combiner: str, other: OriginalXPathExpr, *args: Any, **k
parsel/csstranslator.py:50
Functionload_selector
(filename, **kwargs)
docs/conftest.py:16
Methodmake_selector
(x: Any)
parsel/selector.py:554
Functionmyfunc
(ctx: Any)
tests/test_xpathfuncs.py:91
Methodre
Call the ``.re()`` method for each element in this list and return their results flattened, as a list of strings. By default
parsel/selector.py:196
Methodre_first
( self, regex: str | Pattern[str], default: None = None, replace_entities: boo
parsel/selector.py:209
Functionsetup
()
parsel/xpathfuncs.py:37
Functionsetup
(namespace)
docs/conftest.py:21
Methodtest_accessing_attributes
(self)
tests/test_selector.py:143
Methodtest_attr_function
(self, css: str, xpath: str)
tests/test_selector_csstranslator.py:76
Methodtest_attr_function_exception
(self, css: str, exc: type[Exception])
tests/test_selector_csstranslator.py:87
Methodtest_attrib_empty_json
(self)
tests/test_selector.py:1088
Methodtest_attribute_function
(self)
tests/test_selector_csstranslator.py:194
Functiontest_billion_laughs
()
tests/test_xml_attacks.py:20
Methodtest_bodies_with_comments_only
(self)
tests/test_selector.py:693
Methodtest_body_bytearray_support
(self)
tests/test_selector.py:1080
Methodtest_bool
(self)
tests/test_selector.py:328
Methodtest_boolean_result
(self)
tests/test_selector.py:298
Methodtest_check_text_argument_type
(self)
tests/test_selector.py:189
Methodtest_check_text_argument_type
(self)
tests/test_selector.py:1260
Methodtest_configure_base_url
(self)
tests/test_selector.py:854
Functiontest_css2xpath
()
tests/test_selector_csstranslator.py:164
Methodtest_deep_nesting
(self)
tests/test_selector.py:940
Methodtest_default_type
(self)
tests/test_selector.py:1015
Methodtest_differences_parsing_xml_vs_html
Test that XML and HTML Selector's behave differently
tests/test_selector.py:304
Methodtest_dont_remove_text_after_deleted_element
(self)
tests/test_selector.py:1204
Methodtest_dont_strip
(self)
tests/test_selector.py:428
Methodtest_drop_with_xml_type
(self)
tests/test_selector.py:1211
Methodtest_empty_bodies_shouldnt_raise_errors
(self)
tests/test_selector.py:690
Methodtest_error_for_unknown_selector_type
(self)
tests/test_selector.py:318
Methodtest_etree_root_invalid_type
(self)
tests/test_selector.py:1065
Methodtest_extending_selector
(self)
tests/test_selector.py:858
Methodtest_extract_first
Test if extract_first() returns first element
tests/test_selector.py:193
Methodtest_extract_first_default
Test if extract_first() returns default value when no results found
tests/test_selector.py:215
Methodtest_extract_first_re_default
Test if re_first() returns default value when no results found
tests/test_selector.py:273
Functiontest_extract_regex
( regex: str | Pattern[str], text: str, replace_entities: bool, expected: list[str], )
tests/test_utils.py:91
Functiontest_has_class_error_invalid_arg_type
()
tests/test_xpathfuncs.py:39
Functiontest_has_class_error_invalid_unicode
()
tests/test_xpathfuncs.py:48
Functiontest_has_class_error_no_args
()
tests/test_xpathfuncs.py:30
Functiontest_has_class_newline
()
tests/test_xpathfuncs.py:73
Functiontest_has_class_simple
()
tests/test_xpathfuncs.py:11
next →1–100 of 186, ranked by callers