| Server IP : 172.67.131.151 / Your IP : 104.23.243.108 Web Server : Apache System : Linux keen-cori.18-142-40-148.plesk.page 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 06:59:36 UTC 2025 x86_64 User : simottodesign.com_2tntp341vs7 ( 10011) PHP Version : 8.3.31 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /lib/python3/dist-packages/bs4/__pycache__/ |
Upload File : |
U
t�^�q � @ s d Z dZdZdZdZdgZddlZddlZddlZddl Z ddl
Z
dd lmZm
Z
dd
lmZ ddlmZmZmZmZmZmZmZmZmZmZmZ dd
k G dd� de�ZeZeZG dd� de�ZG dd� de �Z!G dd� de"�Z#e$dk�r
ddlZeej%�Z&e'e&�(� � dS )aK Beautiful Soup Elixir and Tonic - "The Screen-Scraper's Friend".
http://www.crummy.com/software/BeautifulSoup/
Beautiful Soup uses a pluggable XML or HTML parser to parse a
(possibly invalid) document into a tree representation. Beautiful Soup
provides methods and Pythonic idioms that make it easy to navigate,
search, and modify the parse tree.
Beautiful Soup works with Python 2.7 and up. It works better if lxml
and/or html5lib is installed.
For more than you ever wanted to know about Beautiful Soup, see the
documentation: http://www.crummy.com/software/BeautifulSoup/bs4/doc/
z*Leonard Richardson ([email protected])z4.8.2z*Copyright (c) 2004-2019 Leonard RichardsonZMIT�
BeautifulSoup� N� )�builder_registry�ParserRejectedMarkup)�
UnicodeDammit)�CData�Comment�DEFAULT_OUTPUT_ENCODING�Declaration�Doctype�NavigableString�PageElement�ProcessingInstruction� ResultSet�SoupStrainer�Tagz`You are trying to run the Python 2 version of Beautiful Soup under Python 3. This will not work.zuYou need to convert the code, either by installing it (`python setup.py install`) or by running 2to3 (`2to3 -w bs4`).c s� e Zd ZdZdZddgZdZdZd4d d
�Zdd� Z d
d� Z
edd� �Zdd� Z
dd� Zddi ddfdd�Zd5dd�Zdd� Zdd� Zdd� Zdd � Zd6d!d"�Zd7d#d$�Zd%d&� Zd8d(d)�Zd9d*d+�Zd:d,d-�Zd.d/� Zd0ed1f� fd2d3� Z� ZS );r a� A data structure representing a parsed HTML or XML document.
Most of the methods you'll call on a BeautifulSoup object are inherited from
PageElement or Tag.
Internally, this class defines the basic interface called by the
tree builders when converting an HTML/XML document into a data
structure. The interface abstracts away the differences between
parsers. To write a new tree builder, you'll need to understand
these methods as a whole.
These methods will be called by the BeautifulSoup constructor:
* reset()
* feed(markup)
The tree builder may call these methods from its feed() implementation:
* handle_starttag(name, attrs) # See note about return value
* handle_endtag(name)
* handle_data(data) # Appends to the current data node
* endData(containerClass) # Ends the current data node
No matter how complicated the underlying parser is, you should be
able to build a tree using 'start tag' events, 'end tag' events,
'data' events, and "done with data" events.
If you encounter an empty-element tag (aka a self-closing tag,
like HTML's <br> tag), call handle_starttag and then
handle_endtag.
z
[document]ZhtmlZfastz
a� No parser was explicitly specified, so I'm using the best available %(markup_type)s parser for this system ("%(parser)s"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.
The code that caused this warning is on line %(line_number)s of the file %(filename)s. To get rid of this warning, pass the additional argument 'features="%(parser)s"' to the BeautifulSoup constructor.
� Nc s
d� kr� d= t �d� d� kr0� d= t �d� d� krH� d= t �d� d� kr`� d= t �d� d � krx� d = t �d
� � fdd�} |p�| d
d�}|p�| dd�}|r�t|t�r�t �d� d}|p�t� | _|}
|}t|t�r�|}d}n^|dk�rBt|t�r�|g}|dk�st|�dk�r| j}t j
|� }|dk�rBtdd�|� ��|dk�r,|f � �}|
�s<||j
k�s<||jk�s<|j�r�d}
nd}
d}zt�d�}W n tk
�r� Y nX |�r�|j}|j}n
tj}d}|�d�}|�r�|�� }|�d��r�|dd� }|�r<t|||j
|
d�}t j| j| dd� n� �r<t �d� || _|j| _| j| _t� | _|| _| j�| � t|d ��r�|� � }n�t|�d!k�rPt|t!��r�d"|k�s�t|t��rPd#|k�rPt|t��r�t"j#j$�s�|�%d$�}n|}d%}zt"j#�&|�}W n$ t'k
�r } zW 5 d}~X Y nX |�rFt|t��r8|�%d$�}t �d&| � | �(|� g }d%}| jj)|||d'�D ]f\| _*| _+| _,| _-| �.� z| �/� d(}W �q�W n. t0k
�r� } z|�1|� W 5 d}~X Y nX �qj|�s�d)d*� |D �}t0d+d,�|� ��d| _*d| j_2dS )-a Constructor.
:param markup: A string or a file-like object representing
markup to be parsed.
:param features: Desirable features of the parser to be
used. This may be the name of a specific parser ("lxml",
"lxml-xml", "html.parser", or "html5lib") or it may be the
type of markup to be used ("html", "html5", "xml"). It's
recommended that you name a specific parser, so that
Beautiful Soup gives you the same results across platforms
and virtual environments.
:param builder: A TreeBuilder subclass to instantiate (or
instance to use) instead of looking one up based on
`features`. You only need to use this if you've implemented a
custom TreeBuilder.
:param parse_only: A SoupStrainer. Only parts of the document
matching the SoupStrainer will be considered. This is useful
when parsing part of a document that would otherwise be too
large to fit into memory.
:param from_encoding: A string indicating the encoding of the
document to be parsed. Pass this in if Beautiful Soup is
guessing wrongly about the document's encoding.
:param exclude_encodings: A list of strings indicating
encodings known to be wrong. Pass this in if you don't know
the document's encoding but you know Beautiful Soup's guess is
wrong.
:param element_classes: A dictionary mapping BeautifulSoup
classes like Tag and NavigableString, to other classes you'd
like to be instantiated instead as the parse tree is
built. This is useful for subclassing Tag or NavigableString
to modify default behavior.
:param kwargs: For backwards compatibility purposes, the
constructor accepts certain keyword arguments used in
Beautiful Soup 3. None of these arguments do anything in
Beautiful Soup 4; they will result in a warning and then be
ignored.
Apart from this, any keyword arguments passed into the
BeautifulSoup constructor are propagated to the TreeBuilder
constructor. This makes it possible to configure a
TreeBuilder by passing in arguments, not just by saying which
one to use.
ZconvertEntitiesz�BS4 does not respect the convertEntities argument to the BeautifulSoup constructor. Entities are always converted to Unicode characters.Z
markupMassagez�BS4 does not respect the markupMassage argument to the BeautifulSoup constructor. The tree builder is responsible for any necessary markup massage.Z
smartQuotesToz�BS4 does not respect the smartQuotesTo argument to the BeautifulSoup constructor. Smart quotes are always converted to Unicode characters.ZselfClosingTagsz�BS4 does not respect the selfClosingTags argument to the BeautifulSoup constructor. The tree builder is responsible for understanding self-closing tags.ZisHTMLz�BS4 does not respect the isHTML argument to the BeautifulSoup constructor. Suggest you use features='lxml' for HTML and features='lxml-xml' for XML.c s0 | � kr,t �d| |f � � | }� | = |S d S )NzLThe "%s" argument to the BeautifulSoup constructor has been renamed to "%s.")�warnings�warn)Zold_name�new_name�value��kwargs� �./usr/lib/python3/dist-packages/bs4/__init__.py�deprecated_argument� s ��z3BeautifulSoup.__init__.<locals>.deprecated_argumentZparseOnlyThese�
parse_onlyZfromEncoding�
from_encodingzlYou provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.Nr zjCouldn't find a tree builder with the features you requested: %s. Do you need to install a parser library?�,ZXMLZHTMLr �__file__)z.pycz.pyo���)�filename�line_number�parser�markup_type� )�
stacklevelz�Keyword arguments to the BeautifulSoup constructor will be ignored. These would normally be passed into the TreeBuilder constructor, but a TreeBuilder instance was passed in as `builder`.�read� � <�<�utf8Fzw"%s" looks like a filename, not markup. You should probably open this file and pass the filehandle into Beautiful Soup.)�exclude_encodingsTc S s g | ]}t |��qS r )�str)�.0�er r r �
<listcomp>M s z*BeautifulSoup.__init__.<locals>.<listcomp>z�The markup you provided was rejected by the parser. Trying a different parser or a different encoding may help.
Original exception(s) from parser:
z
)3r r �
isinstancer- �dict�element_classes�type�len�DEFAULT_BUILDER_FEATURESr �lookup�FeatureNotFound�join�NAMEZALTERNATE_NAMES�is_xml�sys� _getframe�
ValueError� f_globals�f_lineno�__dict__�get�lower�endswith�NO_PARSER_SPECIFIED_WARNING�builderZ known_xmlZ_namespacesr Zinitialize_soup�hasattrr'