
    hm                        % S r SSKrSSKrSSKrSSKJr  SSKJrJrJrJ	r	J
r
JrJrJrJrJrJrJrJr  SSKJr  SSKrSSKJrJr  SSKJr  SS	KJrJr  SS
KJrJrJ r J!r!  \" SSS9r"\\RF                  \RH                  4   r%\	S   r&\" \RN                  5      r(\" S5      r)\(\):  r* " S S\+5      r, " S S\+5      r- " S S\-5      r. " S S\RF                  5      r/ " S S\5      r0\RH                  \" 5       SS.\/\" 5       SS.S.r1\\2\04   \3S'   S\\2   S\24S  jr4S\*S!S"4S#\2S$\\%   S%\\2   S&\5S'\6S(\2S\Rn                  4S) jjr8 " S* S+\\"   5      r9\:" 5       r;S#\2S\2S,\S\Rn                  4S- jr<S'\6S(\2S.\\2   S,\S\\\24   4
S/ jr=S#\2S.\\2   S,\S\\\24   4S0 jr>S1\S.\\2   S\24S2 jr?S#\2S\54S3 jr@S#\2S\4S4 jrA " S5 S5      rBg)6zLXPath and JMESPath selectors based on the lxml and jmespath Python
packages.    N)BytesIO)AnyDictListLiteralMappingOptionalPatternSupportsIndexTupleType	TypedDictTypeVarUnion)warn)etreehtml)Version   )GenericTranslatorHTMLTranslator)extract_regexflatteniflattenshorten_SelectorTypeSelector)boundr   xmlz4.2c                       \ rS rSrSrg)CannotRemoveElementWithoutRoot-    N__name__
__module____qualname____firstlineno____static_attributes__r$       V/root/1688_scrapy/alibaba-scraper/venv/lib/python3.13/site-packages/parsel/selector.pyr"   r"   -       r+   r"   c                       \ rS rSrSrg) CannotRemoveElementWithoutParent1   r$   Nr%   r$   r+   r,   r/   r/   1   r-   r+   r/   c                       \ rS rSrSrg)CannotDropElementWithoutParent5   r$   Nr%   r$   r+   r,   r2   r2   5   r-   r+   r2   c                   8   ^  \ rS rSrS\S\SS4U 4S jjrSrU =r$ )SafeXMLParser9   argskwargsreturnNc                 J   > UR                  SS5        [        TU ]  " U0 UD6  g )Nresolve_entitiesF)
setdefaultsuper__init__)selfr7   r8   	__class__s      r,   r>   SafeXMLParser.__init__:   s&    ,e4$)&)r+   r$   )r&   r'   r(   r)   r   r>   r*   __classcell__r@   s   @r,   r5   r5   9   s"    *c *S *T * *r+   r5   c                   |    \ rS rSr% \\\R                     \\R                     4   \
S'   \\\4   \
S'   \\
S'   Srg)CTGroupValue?   _parser_csstranslator_tostring_methodr$   N)r&   r'   r(   r)   r   r   r   	XMLParserr   
HTMLParser__annotations__r   r   _TostringMethodTyper*   r$   r+   r,   rE   rE   ?   s;    4($t*??@@+^;<<))r+   rE   r   )rG   rH   rI   r    _ctgrouptyper9   c                     U S:X  a  S$ S$ )Nr    r   r$   rO   s    r,   _xml_or_htmlrR   S   s    EM5-v-r+   r+   utf-8text
parser_clsbase_url	huge_treebodyencodingc                    U (       d!  UR                  SS5      R                  5       nO8U R                  5       R                  SS5      R                  U5      =(       d    SnU(       a)  [        (       a  U" SUSS9n[        R
                  " XFUS9nO_U" SUS	9n[        R
                  " XFUS9nUR                   H3  nS
UR                  ;   d  M  [        R                  " S[         S35        M5     Uc  [        R
                  " SXbS9nU$ )z3Create root node for text using given parser class.    r+     s   <html/>T)recoverrY   rW   )parserrV   )r^   rY   zuse XML_PARSE_HUGE optionz'Input data is too big. Upgrade to lxml z  or later for huge_tree support.)replacestripencodeLXML_SUPPORTS_HUGE_TREEr   
fromstring	error_logmessagewarningsr   lxml_huge_tree_version)	rT   rU   rV   rW   rX   rY   r_   rooterrors	            r,   create_root_noderk   W   s     ||GS)//1zz|##FB/66x@NJ,,D8tLhGD8<hG%%E*emm;=-..NP & |
6MKr+   c                     ^  \ rS rSrSr\R                  SSS\4S j5       r\R                  S\	SS4S j5       rS\
S\	4   S\
\S4   4U 4S	 jjrS"S jrS\S\SS4S jr S#S\S\\\\4      S\SS4S jjrS\SS4S jr S$S\
\\\   4   S\S\\   4S jjr\R                    S%S\
\\\   4   SS
S\S\\   4S jj5       r\R                   S$S\
\\\   4   S\S\S\4S jj5       r  S%S\
\\\   4   S\\   S\S\\   4S jjrS\\   4S jr\r\R                  S#SS
S\\   4S jj5       r\R                  S\S\4S j5       rS#S\\   S\4S jjr\r\S\\\4   4S j5       rS"S jrS"S  jrS!r U =r!$ )&SelectorListv   zw
The :class:`SelectorList` class is a subclass of the builtin ``list``
class, which provides a few additional methods.
posr   r9   c                     g Nr$   r?   ro   s     r,   __getitem__SelectorList.__getitem__|       r+   SelectorList[_SelectorType]c                     g rq   r$   rr   s     r,   rs   rt      ru   r+   c                    > [         TU ]  U5      n[        U[        5      (       a&  U R	                  [
        R                  " SU5      5      $ [
        R                  " [        U5      $ )Nrv   )r=   rs   
isinstanceslicer@   typingcastr   )r?   ro   or@   s      r,   rs   rt      sM     G$c5!!>>&++.KQ"OPP;;}a00r+   Nc                     [        S5      e)Nz!can't pickle SelectorList objects	TypeErrorr?   s    r,   __getstate__SelectorList.__getstate__   s    ;<<r+   queryr8   c                     U R                  [        U  Vs/ s H  o3R                  " U40 UD6PM     sn5      5      $ s  snf )a  
Call the ``.jmespath()`` method for each element in this list and return
their results flattened as another :class:`SelectorList`.

``query`` is the same argument as the one in :meth:`Selector.jmespath`.

Any additional named arguments are passed to the underlying
``jmespath.search`` call, e.g.::

    selector.jmespath('author.name', options=jmespath.Options(dict_cls=collections.OrderedDict))
)r@   r   jmespath)r?   r   r8   xs       r,   r   SelectorList.jmespath   s6     ~~gD&QDqzz%'B6'BD&QRSS&Qs   <xpath
namespacesc                     U R                  [        U  Vs/ s H  oDR                  " U4SU0UD6PM     sn5      5      $ s  snf )al  
Call the ``.xpath()`` method for each element in this list and return
their results flattened as another :class:`SelectorList`.

``xpath`` is the same argument as the one in :meth:`Selector.xpath`

``namespaces`` is an optional ``prefix: namespace-uri`` mapping (dict)
for additional prefixes to those registered with ``register_namespace(prefix, uri)``.
Contrary to ``register_namespace()``, these prefixes are not
saved for future calls.

Any additional named arguments can be used to pass values for XPath
variables in the XPath expression, e.g.::

    selector.xpath('//a[href=$url]', url="http://www.example.com")
r   )r@   r   r   )r?   r   r   r8   r   s        r,   r   SelectorList.xpath   s@    , ~~dSdWWUDzDVDdST
 	
Ss   >c           
      ~    U R                  [        U  Vs/ s H  o"R                  U5      PM     sn5      5      $ s  snf )z
Call the ``.css()`` method for each element in this list and return
their results flattened as another :class:`SelectorList`.

``query`` is the same argument as the one in :meth:`Selector.css`
)r@   r   css)r?   r   r   s      r,   r   SelectorList.css   s0     ~~gT&BTuuU|T&BCDD&Bs   :regexreplace_entitiesc           
      \    [        U  Vs/ s H  o3R                  XS9PM     sn5      $ s  snf )a9  
Call the ``.re()`` method for each element in this list and return
their results flattened, as a list of strings.

By default, character entity references are replaced by their
corresponding character (except for ``&amp;`` and ``&lt;``.
Passing ``replace_entities`` as ``False`` switches off these
replacements.
r   )r   re)r?   r   r   r   s       r,   r   SelectorList.re   s-     PTUPT1UFPTUVVUs   )defaultc                     g rq   r$   r?   r   r   r   s       r,   re_firstSelectorList.re_first        	r+   c                     g rq   r$   r   s       r,   r   r      r   r+   c                 z   ^^ [        UU4S jU  5       5       H  n[        R                  " [        U5      s  $    U$ )a  
Call the ``.re()`` method for the first element in this list and
return the result in an string. If the list is empty or the
regex doesn't match anything, return the default value (``None`` if
the argument is not provided).

By default, character entity references are replaced by their
corresponding character (except for ``&amp;`` and ``&lt;``.
Passing ``replace_entities`` as ``False`` switches off these
replacements.
c              3   B   >#    U  H  oR                  TTS 9v   M     g7f)r   N)r   ).0r   r   r   s     r,   	<genexpr>(SelectorList.re_first.<locals>.<genexpr>   s       
DHqDD)9D:Ds   )r   r{   r|   str)r?   r   r   r   els    ` ` r,   r   r      s;    "  
DH
 
B ;;sB''
 r+   c                 L    U  Vs/ s H  oR                  5       PM     sn$ s  snf )zt
Call the ``.get()`` method for each element is this list and return
their results flattened, as a list of strings.
getr?   r   s     r,   getallSelectorList.getall   s     
 "&&A&&&s   !c                     g rq   r$   r?   r   s     r,   r   SelectorList.get  ru   r+   c                     g rq   r$   r   s     r,   r   r     ru   r+   c                 8    U  H  nUR                  5       s  $    U$ )zu
Return the result of ``.get()`` for the first element in this list.
If the list is empty, return the default value.
r   )r?   r   r   s      r,   r   r   	  s    
 A557N r+   c                 0    U  H  nUR                   s  $    0 $ )zdReturn the attributes dictionary for the first element.
If the list is empty, return an empty dict.
)attribr   s     r,   r   SelectorList.attrib  s    
 A88O 	r+   c                 T    [        S[        SS9  U  H  nUR                  5         M     g)zE
Remove matched nodes from the parent for each element in this list.
zuMethod parsel.selector.SelectorList.remove is deprecated, please use parsel.selector.SelectorList.drop method instead   category
stacklevelN)r   DeprecationWarningremover   s     r,   r   SelectorList.remove  s-     	 D'	

 AHHJ r+   c                 6    U  H  nUR                  5         M     g)zC
Drop matched nodes from the parent for each element in this list.
N)dropr   s     r,   r   SelectorList.drop)  s     AFFH r+   r$   r9   Nrq   TNT)"r&   r'   r(   r)   __doc__r{   overloadr   rs   rz   r   r   r   r   r   r	   r   r   r   r
   boolr   r   r   r   extractr   extract_firstpropertyr   r   r   r*   rB   rC   s   @r,   rm   rm   v   s   
 __ =   __u )F  1%/01	};;	<1=Tc TS T5R T" 37

 WS#X./
 	

 
'
4E E!> E IMW3,-WAEW	cW __ !%	S'#,&'  	
 
#  __
 "&	S'#,&'  	
 
  "&!%	S'#,&' # 	
 
#.'S	 ' G__4 8C=   __3 3  8C= C  MS)  
 r+   rm   lxml_kwargsc                0    [        U [        U   S   40 UD6$ )NrG   )rk   rN   )rT   rO   r   s      r,   _get_root_from_textr   4  s    D(4.";K{KKr+   
input_typec                4   US:X  a  U R                  U5      U4$ US:X  a-   [        R                  " [        U 5      5      nU[
        La  US4$ US:X  a  gUS;   d   e[        U5      n[        S	SU U[        U   S   S.UD6nXe4$ ! [         a	    [
        n NVf = f)
NrT   rS   jsonNr   r   r    Nr]   rG   )rT   rX   rY   rU   r$   )	decoder   loadr   
ValueError_NOT_SETrR   rk   rN   )rX   rY   r   r   datarO   ri   s          r,   _get_root_and_type_from_bytesr   8  s     V{{8$j007	99WT]+D x<V....
#D D>),	
 D :  	D	s   B BBc                    US:X  a  X4$  [         R                  " U 5      nU[        La  US4$ US:X  a  gUS;   d   e[	        U5      n[        U 4SU0UD6nXT4$ ! [         a	    [        n NJf = f)NrT   r   r   r   rO   )r   loadsr   r   rR   r   )rT   r   r   r   rO   ri   s         r,   _get_root_and_type_from_textr   V  s     Vzz$ 8V|V....
#Dt>$>+>D:  s   A A,+A,ri   c                    [        U [        R                  5      (       a!  US;   a  [        SU< S35      e[	        U5      $ [        U [
        [        45      (       d  [        U 5      (       a  gU=(       d    S$ )N>   r   rT   z8Selector got an lxml.etree._Element object as root, and z	 as type.r   )ry   r   _Elementr   rR   dictlist_is_valid_json)ri   r   s     r,   _get_root_typer   i  sp    $''))!nI/  J''	D4,	'	'>$+?+?r+   c                 ^     [         R                  " U 5        g! [        [        4 a     gf = f)NTF)r   r   r   r   rT   s    r,   r   r   v  s1    

4  z" s    ,,c                     [        U [        [        [        45      (       a   [        R
                  " U 5      $ g ! [         a     g f = frq   )ry   r   bytes	bytearrayr   r   r   r   s    r,   _load_json_or_noner     sC    $eY/00	::d##   		s   9 
AAc                   X   \ rS rSrSr/ SQrSSS.rSr\S    r	SSS	S
S\
SS\4	S\\   S\\   S\S\S\\\\4      S\\   S\\   S\\   S\SS4S jjrS\4S jrSS\SS	S
4S\S\\   S\S\\   S\S\S\R*                  4S jjrS\S\S\S\\   4S jr S4S\S\S\\\\4      S\S\\   4
S jjrS\S\S\\   4S jrS\S\4S jr S5S \\\\   4   S!\S\\   4S" jjr\ RB                    S6S \\\\   4   S#SS!\S\\   4S$ jj5       r"\ RB                   S5S \\\\   4   S#\S!\S\4S% jj5       r"  S6S \\\\   4   S#\\   S!\S\\   4S& jjr"S\4S' jr#\#r$S\\   4S( jr%S)\S*\SS4S+ jr&S7S, jr'S7S- jr(S7S. jr)\*S\+\\4   4S/ j5       r,S\4S0 jr-\-r.S\4S1 jr/S\4S2 jr0S3r1g)8r   i  ab  Wrapper for input data in HTML, JSON, or XML format, that allows
selecting parts of it using selection expressions.

You can write selection expressions in CSS or XPath for HTML and XML
inputs, or in JMESPath for JSON inputs.

``text`` is an ``str`` object.

``body`` is a ``bytes`` object. It can be used together with the
``encoding`` argument instead of the ``text`` argument.

``type`` defines the selector type. It can be ``"html"`` (default),
``"json"``, or ``"xml"``.

``base_url`` allows setting a URL for the document. This is needed when looking up external entities with relative paths.
See the documentation for :func:`lxml.etree.fromstring` for more information.

``huge_tree`` controls the lxml/libxml2 feature that forbids parsing
certain large documents to protect from possible memory exhaustion. The
argument is ``True`` by default if the installed lxml version supports it,
which disables the protection to allow parsing such documents. Set it to
``False`` if you want to enable the protection.
See `this lxml FAQ entry <https://lxml.de/FAQ.html#is-lxml-vulnerable-to-xml-bombs>`_
for more information.
)r   rO   _expr
_huge_treeri   _textrX   __weakref__z$http://exslt.org/regular-expressionszhttp://exslt.org/sets)r   setFNr+   rS   rT   rO   rX   rY   r   ri   rV   r   rW   r9   c
                 .   U   US;  a  [        SU 35      eUc  U(       d  U[        L a  [        S5      eUb/  [        U[        5      (       d  SUR                   3n
[        U
5      eUbh  U[        La  [        R                  " SSS9  [        U[        5      (       d  SUR                   3n
[        U
5      e[        UUUU	S9u  pbX`l	        X l
        OzU(       aK  [        U[        5      (       d  S	UR                   3n
[        U
5      e[        UUUUU	S
9u  pbX`l	        X l
        O(U[        L a  [        S5      eX`l	        [        XbS9U l
        [        U R                  5      U l        Ub  U R                   R#                  U5        Xl        Xl        Xl        g )N)r   r   rT   r    NzInvalid type: z,Selector needs text, body, or root argumentsz)text argument should be of type str, got z7Selector got both text and root, root is being ignored.r   )r   )r   rV   rW   z+body argument should be of type bytes, got )rX   rY   r   rV   rW   )r   )r   r   ry   r   r@   r   rg   r   r   ri   rO   r   r   r   r   _default_namespacesr   updater   r   r   )r?   rT   rO   rX   rY   r   ri   rV   r   rW   msgs              r,   r>   Selector.__init__  s    	<<~dV455<)9KLLJtS$9$9=dnn=MNCC. 8#M  dC((A$..AQRn$5!#	JD IIdE**CDNNCSTn$6!!#JD IIXKLLI&t=DIt778!OO"":.
#
r+   c                     [        S5      e)Nzcan't pickle Selector objectsr   r   s    r,   r   Selector.__getstate__  s    788r+   r]   c           	      X    [        UUU[        U=(       d    U R                     S   UUS9$ )NrG   )rX   rY   rU   rV   rW   )rk   rN   rO   )r?   rT   rV   rW   rO   rX   rY   s          r,   	_get_rootSelector._get_root  s6       1		29=
 	
r+   r?   r   r8   c                 <  ^ ^ T R                   S:X  aB  [        T R                  [        5      (       a  [	        T R                  5      nO>T R                  nO1T R                   S;   d   e[	        T R                  R
                  5      n[        R                  " TU40 UD6nUc  / nO[        U[        5      (       d  U/nS[        S[        4UU 4S jjnU Vs/ s H
  oe" U5      PM     nn[        R                  " [        [           T R                  U5      5      $ s  snf )a  
Find objects matching the JMESPath ``query`` and return the result as a
:class:`SelectorList` instance with all elements flattened. List
elements implement :class:`Selector` interface too.

``query`` is a string containing the `JMESPath
<https://jmespath.org/>`_ query to apply.

Any additional named arguments are passed to the underlying
``jmespath.search`` call, e.g.::

    selector.jmespath('author.name', options=jmespath.Options(dict_cls=collections.OrderedDict))
r   >   r    r   r   r9   c                 p   > [        U [        5      (       a  TR                  U TSS9$ TR                  U TS9$ )NrT   )rT   r   rO   )ri   r   )ry   r   r@   )r   r   r?   s    r,   make_selector(Selector.jmespath.<locals>.make_selector6  s8    !S!!~~1E~GG~~1E~::r+   )rO   ry   ri   r   r   rT   r   searchr   r   r   r{   r|   rm   selectorlist_cls)r?   r   r8   r   resultr   r   s   ``     r,   r   Selector.jmespath  s    $ 99$))S)))$))4yy99///%diinn5D77>FFD))XF	;S 	;] 	; 	; -33Fq-"F3{{<68M8Mf8UVV 4s   Dc                    U R                   S;  a  [        SU R                   < 35      eU R                   S;   a   U R                  R                  nO. U R                  U R                  =(       d    SSS9R                  n[        U R                  5      nUb  UR                  U5         U" U4UU R                  S.UD6n[        U5      [$        La  U/nU Vs/ s H2  nU R'                  UUU R                  [)        U R                   5      S9PM4     nn[
        R                  " [        [           U R                  U5      5      $ ! [         a4    [
        R                  " [        [           U R                  / 5      5      s $ f = f! [         a4    [
        R                  " [        [           U R                  / 5      5      s $ f = f! [         R"                   a  n[        S	U S
U 35      eSnAff = fs  snf )a  
Find nodes matching the xpath ``query`` and return the result as a
:class:`SelectorList` instance with all elements flattened. List
elements implement :class:`Selector` interface too.

``query`` is a string containing the XPATH query to apply.

``namespaces`` is an optional ``prefix: namespace-uri`` mapping (dict)
for additional prefixes to those registered with ``register_namespace(prefix, uri)``.
Contrary to ``register_namespace()``, these prefixes are not
saved for future calls.

Any additional named arguments can be used to pass values for XPath
variables in the XPath expression, e.g.::

    selector.xpath('//a[href=$url]', url="http://www.example.com")
r   r    rT   z'Cannot use xpath on a Selector of type r   r]   r   rQ   N)r   smart_stringszXPath error: z in )ri   r   r   rO   )rO   r   ri   r   AttributeErrorr{   r|   rm   r   r   r   r   r   r   r   _lxml_smart_stringsr   
XPathErrorr   r@   rR   )	r?   r   r   r8   xpathevnspr   excr   s	            r,   r   Selector.xpath?  s   . 9933FtyymTUU99'))//..)9r.GMM 4??#!JJz"	?"66 	F <t#XF 
  NN??!$)),	    	 
 {{<68M8Mf8UVVK " {{ /1F1Fr1J  " {{ /1F1Fr1J   	?}SEeW=>>	?
sA   E -F *G 9G4;FF;GGG1G,,G1c                     U R                   S;  a  [        SU R                   < 35      eU R                  U R                  U5      5      $ )a:  
Apply the given CSS selector and return a :class:`SelectorList` instance.

``query`` is a string containing the CSS selector to apply.

In the background, CSS queries are translated into XPath queries using
`cssselect`_ library and run ``.xpath()`` method.

.. _cssselect: https://pypi.python.org/pypi/cssselect/
r   z%Cannot use css on a Selector of type )rO   r   r   
_css2xpath)r?   r   s     r,   r   Selector.css  s@     9933DTYYMRSSzz$//%011r+   c                 b    [        U R                  5      n[        U   S   R                  U5      $ )NrH   )rR   rO   rN   css_to_xpath)r?   r   rO   s      r,   r  Selector._css2xpath  s+    DII&~./<<UCCr+   r   r   c                 6    U R                  5       n[        XUS9$ )a  
Apply the given regex and return a list of strings with the
matches.

``regex`` can be either a compiled regular expression or a string which
will be compiled to a regular expression using ``re.compile(regex)``.

By default, character entity references are replaced by their
corresponding character (except for ``&amp;`` and ``&lt;``).
Passing ``replace_entities`` as ``False`` switches off these
replacements.
r   )r   r   )r?   r   r   r   s       r,   r   Selector.re  s     xxzU;KLLr+   r   c                     g rq   r$   r   s       r,   r   Selector.re_first  r   r+   c                     g rq   r$   r   s       r,   r   r    r   r+   c           	      F    [        [        U R                  XS95      U5      $ )ad  
Apply the given regex and return the first string which matches. If
there is no match, return the default value (``None`` if the argument
is not provided).

By default, character entity references are replaced by their
corresponding character (except for ``&amp;`` and ``&lt;``).
Passing ``replace_entities`` as ``False`` switches off these
replacements.
r   )nextr   r   r   s       r,   r   r    s'      TWWUWFG
 	
r+   c                 @   U R                   S;   a  U R                  $  [        R                  " U R                  [        U R                      S   SSS9$ ! [
        [        4 a:    U R                  SL a   gU R                  SL a   g[        U R                  5      s $ f = f)	z
Serialize and return the matched nodes.

For HTML and XML, the result is always a string, and percent-encoded
content is unquoted.
)rT   r   rI   unicodeF)methodrY   	with_tailT10)rO   ri   r   tostringrN   r   r   r   r   s    r,   r   Selector.get  s     99((99	&>>				*+=>"	  	* 	&yyD e#499~%	&s   4A B4BBBc                 $    U R                  5       /$ )zG
Serialize and return the matched node in a 1-element list of strings.
r   r   s    r,   r   Selector.getall  s     
|r+   prefixuric                      X R                   U'   g)z
Register the given namespace to be used in this :class:`Selector`.
Without registering namespaces you can't select or extract data from
non-standard namespaces. See :ref:`selector-examples-xml`.
N)r   )r?   r  r  s      r,   register_namespaceSelector.register_namespace  s     #&r+   c                    U R                   R                  S5       H  nUR                  R                  S5      (       a$  UR                  R	                  SS5      S   Ul        UR
                   HV  nUR                  S5      (       d  M  UR
                  R                  U5      UR
                  UR	                  SS5      S   '   MX     M     [        R                  " U R                   5        g)zw
Remove all namespaces, allowing to traverse the document using
namespace-less xpaths. See :ref:`removing-namespaces`.
*{}r   N)	ri   itertag
startswithsplitr   popr   cleanup_namespaces)r?   r   ans      r,   remove_namespacesSelector.remove_namespaces  s    
 ))..%Bvv  %%c1-a0ii==%%57YY]]25FBIIbhhsA.q12  	 & 	  +r+   c                     [        S[        SS9   U R                  R                  5       n UR                  U R                  5        g! [         a    [        S5      ef = f! [         a    [        S5      ef = f)z/
Remove matched nodes from the parent element.
zmMethod parsel.selector.Selector.remove is deprecated, please use parsel.selector.Selector.drop method insteadr   r   zThe node you're trying to remove has no root, are you trying to remove a pseudo-element? Try to use 'li' as a selector instead of 'li::text' or '//li' instead of '//li/text()', for example.XThe node you're trying to remove has no parent, are you trying to remove a root element?N)r   r   ri   	getparentr   r"   r   r/   r?   parents     r,   r   Selector.remove  s     	{'	

		YY((*F	MM$))$  	0@ 	  	2; 	s   A A! A!A7c                     U R                   R                  5       n U R                  S:X  a*  Uc  [        S5      eUR                  U R                   5        g[        R                  " [        R                  U R                   5      R                  5         g! [         a    [        S5      ef = f! [        [        4 a    [        S5      ef = f)z-
Drop matched nodes from the parent element.
zThe node you're trying to drop has no root, are you trying to drop a pseudo-element? Try to use 'li' as a selector instead of 'li::text' or '//li' instead of '//li/text()', for example.r    NzThis node has no parentr/  )ri   r0  r   r"   rO   r   r   r{   r|   r   HtmlElement	drop_treeAssertionErrorr2   r1  s     r,   r   Selector.drop"  s    		YY((*F	yyE!>$%>??dii(D,,dii8BBD  	0@ 	  / 	0; 	s   B 9B. =B. B+.C
c                 @    [        U R                  R                  5      $ )z8Return the attributes dictionary for underlying element.)r   ri   r   r   s    r,   r   Selector.attrib?  s     DII$$%%r+   c                 4    [        U R                  5       5      $ )z
Return ``True`` if there is any real content selected or ``False``
otherwise.  In other words, the boolean value of a :class:`Selector` is
given by the contents it selects.
)r   r   r   s    r,   __bool__Selector.__bool__D  s     DHHJr+   c                 4    [        U R                  5       5      $ rq   )r   r   r   s    r,   __str__Selector.__str__N  s    488:r+   c                     [        [        [        U R                  5       5      SS95      nS[	        U 5      R
                   SU R                  < SU S3$ )N(   )width<z query=z data=>)reprr   r   r   rO   r&   r   )r?   r   s     r,   __repr__Selector.__repr__Q  sG    GC
O2674:&&'wtzznF4&JJr+   )r   r   r   r   ri   rO   rq   r   r   r   )2r&   r'   r(   r)   r   	__slots__r   r   rm   r   r   rc   r	   r   r   r   r   r   r>   r   r   r   r   r   r   r   r   r  r   r
   r   r   r{   r   r   r   r   r   r  r,  r   r   r   r   r   r<  __nonzero__r?  rG  r*   r$   r+   r,   r   r     s   4	I 5 '	  #J/ #"26&"&#1BsmB smB 	B
 B WS#X./B smB 3-B }B B 
BH9c 9
 "&1"

 3-
 	

 sm
 
 
 

$)W)W)W )W 
m	$	)W\ 37AWAWAW WS#X./AW 	AW
 
m	$AWF2- 2 2]0K 2D D D
 IMM3,-MAEM	cM$ __ !%	S'#,&'  	
 
#  __
 "&	S'#,&'  	
 
  "&!%	
S'#,&'
 #
 	

 
#
*&S &0 GS	 & &3 &4 &,:: &S#X & & $   K K# Kr+   )Cr   r   r{   rg   ior   r   r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   lxmlr   r   packaging.versionr   csstranslatorr   r   utilsr   r   r   r   r   rJ   rK   _ParserTyperM   __version__lxml_versionrh   rc   	Exceptionr"   r/   r2   r5   rE   rN   r   rL   rR   r   r   r   rk   rm   objectr   r   r   r   r   r   r   r   r$   r+   r,   <module>rU     s             % < < <z:EOOU%5%556 
 u(()  &*@@ 	Y 		y 		%E 	*EOO **9 * ??(*" !+-!%$sL 
! .x} . . #-
[! sm 	
   ^^>x4& xv 8Lc LC L L L
 	
  38_<
&sm<?
38_&
  
 Xc] 
 s 
   S S KK KKr+   