
    Ng"                     (    d Z ddlmZ  G d d      Zy)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
    )Anyc            	       \    e Zd ZdZg dZ	 ddedededefdZded	efd
Z	d	e
fdZd	efdZy)Linka  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.
    urltextfragmentnofollowr   r   r	   r
   c                     t        |t              s$|j                  j                  }t	        d|       || _        || _        || _        || _        y )Nz#Link urls must be str objects, got )	
isinstancestr	__class____name__	TypeErrorr   r   r	   r
   )selfr   r   r	   r
   gots         +lib/python3.12/site-packages/scrapy/link.py__init__zLink.__init__   sL     #s#--((CA#GHH	%&    otherreturnc                    t        |t              st        | j                  |j                  k(  xrO | j                  |j                  k(  xr4 | j
                  |j
                  k(  xr | j                  |j                  k(  S N)r   r   NotImplementedErrorr   r   r	   r
   )r   r   s     r   __eq__zLink.__eq__*   sh    %&%%HH		! 0		UZZ'0/0 /		
r   c                     t        | j                        t        | j                        z  t        | j                        z  t        | j                        z  S r   )hashr   r   r	   r
   r   s    r   __hash__zLink.__hash__4   s;    NT$))_,tDMM/BBT$--EXX	
r   c           	      p    d| j                   d| j                  d| j                  d| j                  d	S )Nz	Link(url=z, text=z, fragment=z, nofollow=)r   r   s    r   __repr__zLink.__repr__9   s>    |7499- 8(DMM3DAG	
r   N) r#   F)r   
__module____qualname____doc__	__slots__r   boolr   r   r   intr   r"    r   r   r   r      se    " 8I NS	'	'!	'25	'FJ	'
C 
D 

# 


# 
r   r   N)r&   typingr   r   r*   r   r   <module>r,      s    2
 2
r   