
    !h                         S r  " S S5      rg)z
This module defines the Link object used in Link extractors.

For actual link extractors implementation see scrapy.linkextractors, or
its documentation in: docs/topics/link-extractors.rst
c            	       n    \ rS rSrSr/ SQr SS\S\S\S\4S jjrS	\	S
\4S jr
S
\4S jrS
\4S jrSrg)Link	   a  Link objects represent an extracted link by the LinkExtractor.

Using the anchor tag sample below to illustrate the parameters::

        <a href="https://example.com/nofollow.html#foo" rel="nofollow">Dont follow this one</a>

:param url: the absolute url being linked to in the anchor tag.
            From the sample, this is ``https://example.com/nofollow.html``.

:param text: the text in the anchor tag. From the sample, this is ``Dont follow this one``.

:param fragment: the part of the url after the hash symbol. From the sample, this is ``foo``.

:param nofollow: an indication of the presence or absence of a nofollow value in the ``rel`` attribute
                of the anchor tag.
)fragmentnofollowtexturlr   r   r   r   c                     [        U[        5      (       d$  UR                  R                  n[	        SU 35      eXl        X l        X0l        X@l        g )Nz#Link urls must be str objects, got )	
isinstancestr	__class____name__	TypeErrorr   r   r   r   )selfr   r   r   r   gots         R/root/1688_scrapy/alibaba-scraper/venv/lib/python3.13/site-packages/scrapy/link.py__init__Link.__init__   sG     #s##--((CA#GHH	%&    otherreturnc                 *   [        U[        5      (       d  [        eU R                  UR                  :H  =(       aY    U R                  UR                  :H  =(       a9    U R
                  UR
                  :H  =(       a    U R                  UR                  :H  $ N)r
   r   NotImplementedErrorr   r   r   r   )r   r   s     r   __eq__Link.__eq__(   sk    %&&%%HH		! 0		UZZ'0/0 /		
r   c                     [        U R                  5      [        U R                  5      -  [        U R                  5      -  [        U R                  5      -  $ r   )hashr   r   r   r   r   s    r   __hash__Link.__hash__2   s;    NT$))_,tDMM/BBT$--EXX	
r   c           	      x    SU R                   < SU R                  < SU R                  < SU R                  < S3	$ )Nz	Link(url=z, text=z, fragment=z, nofollow=))r   r   r   r   r   s    r   __repr__Link.__repr__7   s>    |7499- 8(DMM3DAG	
r   N) r%   F)r   
__module____qualname____firstlineno____doc__	__slots__r   boolr   objectr   intr   r#   __static_attributes__ r   r   r   r   	   se    " 8I NS	'	'!	'25	'FJ	'
F 
t 

# 


# 
r   r   N)r)   r   r/   r   r   <module>r0      s   2
 2
r   