
    Fd                    >    d Z ddlmZ ddlmZ ddlmZ ddZddZdS )zHTML processing functions    )annotations)BeautifulSoup)urljoinsoupr   base_urlstrreturnlist[tuple[str, str]]c                J    fd|                      dd          D             S )zExtract hyperlinks from a BeautifulSoup object

    Args:
        soup (BeautifulSoup): The BeautifulSoup object
        base_url (str): The base URL

    Returns:
        List[Tuple[str, str]]: The extracted hyperlinks
    c                J    g | ]}|j         t          |d                    f S href)textr   ).0linkr   s     KC:\Users\Administrator\Downloads\Auto-GPT-master\autogpt\processing\html.py
<listcomp>z&extract_hyperlinks.<locals>.<listcomp>   s>        
GHd6l334      aTr   )find_all)r   r   s    `r   extract_hyperlinksr      s>       MM#DM11   r   
hyperlinks	list[str]c                    d | D             S )zFormat hyperlinks to be displayed to the user

    Args:
        hyperlinks (List[Tuple[str, str]]): The hyperlinks to format

    Returns:
        List[str]: The formatted hyperlinks
    c                $    g | ]\  }}| d | dS )z () )r   	link_textlink_urls      r   r   z%format_hyperlinks.<locals>.<listcomp>!   s.    NNN,?Ixy''H'''NNNr   r   )r   s    r   format_hyperlinksr       s     ON:NNNNr   N)r   r   r   r   r	   r
   )r   r
   r	   r   )	__doc__
__future__r   bs4r   requests.compatr   r   r    r   r   r   <module>r%      sy      " " " " " "       # # # # # #    	O 	O 	O 	O 	O 	Or   