HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/bin/scripts/python/prev/4/BeautifulSoup.pyc (deleted)
�
=Oc@s�dZddlmZdZdZdZdZddlmZm	Z	ddl
Z
ddlZddlZddl
Z
ddlZydd	lmZWnek
r�iZnXyeWn!ek
r�dd
lmZnXe
jd�e_e
jd�je_d
Zd�Zdefd��YZdeefd��YZdefd��YZdefd��YZ defd��YZ!defd��YZ"defd��YZ#dfd��YZ$de%fd ��YZ&d!�Z'd"e#efd#��YZ(d$e(fd%��YZ)d&e*fd'��YZ+d(e)fd)��YZ,d*e)fd+��YZ-d,e(fd-��YZ.d.e(fd/��YZ/d0e)fd1��YZ0d2e,fd3��YZ1d4e-fd5��YZ2d6e.fd7��YZ3yddl4Z4Wnek
r�e5Z4nXyddl6Z7Wnek
r!nXyddl8Z8Wnek
rEnXd8fd9��YZ9e:d:kr�ddl;Z;e)e;j<�Z=e=j>�GHndS(;s�Beautiful Soup
Elixir and Tonic
"The Screen-Scraper's Friend"
http://www.crummy.com/software/BeautifulSoup/

Beautiful Soup parses a (possibly invalid) XML or HTML document into a
tree representation. It provides methods and Pythonic idioms that make
it easy to navigate, search, and modify the tree.

A well-formed XML/HTML document yields a well-formed data
structure. An ill-formed XML/HTML document yields a correspondingly
ill-formed data structure. If your document is only locally
well-formed, you can use this library to find and process the
well-formed part of it.

Beautiful Soup works with Python 2.2 and up. It has no external
dependencies, but you'll have more success at converting data to UTF-8
if you also install these three packages:

* chardet, for auto-detecting character encodings
  http://chardet.feedparser.org/
* cjkcodecs and iconv_codec, which add more encodings to the ones supported
  by stock Python.
  http://cjkpython.i18n.org/

Beautiful Soup defines classes for two main parsing strategies:

 * BeautifulStoneSoup, for parsing XML, SGML, or your domain-specific
   language that kind of looks like XML.

 * BeautifulSoup, for parsing run-of-the-mill HTML code, be it valid
   or invalid. This class has web browser-like heuristics for
   obtaining a sensible parse tree in the face of common HTML errors.

Beautiful Soup also defines a class (UnicodeDammit) for autodetecting
the encoding of an HTML or XML document, and converting it to
Unicode. Much of this code is taken from Mark Pilgrim's Universal Feed Parser.

For more than you ever wanted to know about Beautiful Soup, see the
documentation:
http://www.crummy.com/software/BeautifulSoup/documentation.html

Here, have some legalese:

Copyright (c) 2004-2010, Leonard Richardson

All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

  * Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.

  * Redistributions in binary form must reproduce the above
    copyright notice, this list of conditions and the following
    disclaimer in the documentation and/or other materials provided
    with the distribution.

  * Neither the name of the the Beautiful Soup Consortium and All
    Night Kosher Bakery nor the names of its contributors may be
    used to endorse or promote products derived from this software
    without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE, DAMMIT.

i����(t
generatorss*Leonard Richardson (leonardr@segfault.org)s3.2.1s*Copyright (c) 2004-2012 Leonard Richardsons
New-style BSD(t
SGMLParsertSGMLParseErrorN(tname2codepoint(tSets[a-zA-Z][-_.:a-zA-Z0-9]*s-zA-Z][-_.:a-zA-Z0-9]*\s*sutf-8cCstjd|�S(s(Build a RE to match the given CSS class.s(^|.*\s)%s($|\s)(tretcompile(tstr((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt_match_css_classkstPageElementcBs�eZdZd�Zidd6dd6dd6dd	6d
d6Zee�Zd*d*d�Zd
�Zd�Z	d�Z
d�Zd�Zd�Z
d*id*d�Zd*id*d*d�Zd*id*d�Zd*id*d*d�ZeZd*id*d�Zd*id*d*d�ZeZd*id*d�Zd*id*d*d�ZeZd*id�Zd*id*d�ZeZd�Zd�Zd�Zd �Zd!�Z d"�Z!d#�Z"d*d$�Z#d*d%�Z$e%j&d&d'd(�Z'd)�Z(RS(+seContains the navigational information for some part of the page
    (either a tag or a piece of text)cCs1i}x$|j�D]\}}|||<qW|S(s Cheap function to invert a hash.(titems(thtitktv((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt_invertust'tapost"tquott&tampt<tltt>tgtcCsh||_||_d|_d|_d|_|jrd|jjrd|jjd|_||j_ndS(sNSets up the initial relations between this element and
        other elements.i����N(tparenttprevioustNonetnexttpreviousSiblingtnextSiblingtcontents(tselfRR((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pytsetup�s					cCs�|j}|jj|�}t|d�rp|j|jkrp|jj|�}|rp||krp|d}qpn|j�|j||�dS(NRi(Rtindexthasattrtextracttinsert(R!treplaceWitht	oldParenttmyIndexR#((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR'�s	
cCsc|j}|jj|�}|j�t|j�}|j�x|D]}|j||�qEWdS(N(RR#R%tlistR treverseR&(R!tmyParentR)treversedChildrentchild((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pytreplaceWithChildren�s	


cCs�|jr=y|jj|jj|�=Wq=tk
r9q=Xn|j�}|j}|jrj||j_n|r|j|_nd|_d|_d|_|jr�|j	|j_	n|j	r�|j|j	_nd|_|_	|S(s0Destructively rips this element out of the tree.N(
RR R#t
ValueErrort_lastRecursiveChildRRRRR(R!t	lastChildtnextElement((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR%�s(	
							cCs6|}x)t|d�r1|jr1|jd}q	W|S(s8Finds the last element beneath this object to be parsed.R i����(R$R (R!R2((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR1�sc	Cst|t�r.t|t�r.t|�}nt|t|j��}t|d�r�|jdk	r�|j|kr�|j	|�}||kr�|d}q�n|j
�n||_d}|dkr�d|_||_n5|j|d}||_||j_
|j�|_|jr(||j_n|j�}|t|j�kr�d|_
|}d}x&|s�|j
}|j}|saPqaqaW|r�||_q�d|_n7|j|}||_
|j
r�||j
_n||_|jr�||j_n|jj||�dS(NRii(t
isinstancet
basestringtNavigableStringtmintlenR R$RRR#R%RRRR1RR&(	R!tpositiontnewChildR#t
previousChildtnewChildsLastElementRtparentsNextSiblingt	nextChild((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR&�sT
								
				cCs|jt|j�|�dS(s2Appends the given tag to the contents of this tag.N(R&R8R (R!ttag((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pytappendscKs|j|j||||�S(sjReturns the first item that matches the given criteria and
        appears after this Tag in the document.(t_findOnetfindAllNext(R!tnametattrsttexttkwargs((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pytfindNextscKs|j|||||j|�S(sbReturns all items that match the given criteria and appear
        after this Tag in the document.(t_findAllt
nextGenerator(R!RCRDREtlimitRF((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyRBscKs|j|j||||�S(s{Returns the closest sibling to this Tag that matches the
        given criteria and appears after this Tag in the document.(RAtfindNextSiblings(R!RCRDRERF((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pytfindNextSiblingscKs|j|||||j|�S(sqReturns the siblings of this Tag that match the given
        criteria and appear after this Tag in the document.(RHtnextSiblingGenerator(R!RCRDRERJRF((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyRKscKs|j|j||||�S(skReturns the first item that matches the given criteria and
        appears before this Tag in the document.(RAtfindAllPrevious(R!RCRDRERF((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pytfindPrevious%scKs|j|||||j|�S(scReturns all items that match the given criteria and appear
        before this Tag in the document.(RHtpreviousGenerator(R!RCRDRERJRF((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyRN*scKs|j|j||||�S(s|Returns the closest sibling to this Tag that matches the
        given criteria and appears before this Tag in the document.(RAtfindPreviousSiblings(R!RCRDRERF((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pytfindPreviousSibling2scKs|j|||||j|�S(srReturns the siblings of this Tag that match the given
        criteria and appear before this Tag in the document.(RHtpreviousSiblingGenerator(R!RCRDRERJRF((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyRQ8scKs2d}|j||d�}|r.|d}n|S(sOReturns the closest parent of this Tag that matches the given
        criteria.iiN(RtfindParents(R!RCRDRFtrtl((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt
findParent@s

cKs|j||d||j|�S(sFReturns the parents of this Tag that match the given
        criteria.N(RHRtparentGenerator(R!RCRDRJRF((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyRTKscKs5d}||||d|�}|r1|d}n|S(Nii(R(R!tmethodRCRDRERFRURV((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyRAUs

c
Kswt|t�r|}n�|dkr�|r�|r�|r�|tkrng|�D]}t|t�rO|^qOSt|t�r�g|�D]*}t|t�r�|j|kr�|^q�St||||�}nt||||�}t|�}	|�}
xytrry|
j�}Wnt	k
r$PnX|r�|j
|�}|ro|	j|�|rlt|	�|krlPqlqoq�q�W|	S(s8Iterates over a generator looking for things that match.N(
R4tSoupStrainerRtTruetTagR5RCt	ResultSetRt
StopIterationtsearchR@R8(
R!RCRDRERJt	generatorRFtstrainertelementtresultstgRtfound((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyRH\s4	!		

ccs+|}x|dk	r&|j}|Vq	WdS(N(RR(R!R((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyRI�s	ccs+|}x|dk	r&|j}|Vq	WdS(N(RR(R!R((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyRM�s	ccs+|}x|dk	r&|j}|Vq	WdS(N(RR(R!R((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyRP�s	ccs+|}x|dk	r&|j}|Vq	WdS(N(RR(R!R((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyRS�s	ccs+|}x|dk	r&|j}|Vq	WdS(N(RR(R!R((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyRX�s	cCs|p	d}|jd|�S(Nsutf-8s%SOUP-ENCODING%(treplace(R!Rtencoding((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pytsubstituteEncoding�scCs�t|t�r*|r�|j|�}q�nct|t�r`|rQ|j|�}q�t|�}n-|r�|jt|�|�}nt|�}|S(sHEncodes an object to a string in some encoding, or to Unicode.
        .(R4tunicodetencodeRt
toEncoding(R!tsRg((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyRk�ss([<>]|s&(?!#\d+;|#x[0-9a-fA-F]+;|\w+;)t)cCs d|j|jd�ddS(smUsed with a regular expression to substitute the
        appropriate XML entity for an XML special character.Rit;(tXML_SPECIAL_CHARS_TO_ENTITIEStgroup(R!tx((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt_sub_entity�sN()t__name__t
__module__t__doc__RtXML_ENTITIES_TO_SPECIAL_CHARSRoRR"R'R/R%R1R&R@RGRBRLRKtfetchNextSiblingsRORNt
fetchPreviousRRRQtfetchPreviousSiblingsRWRTtfetchParentsRARHRIRMRPRSRXRhRkRRtBARE_AMPERSAND_OR_BRACKETRr(((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR	qsT	

						;				&					R6cBs8eZd�Zd�Zd�Zd�Zed�ZRS(cCs2t|t�rtj||�Stj||t�S(s-Create a new NavigableString.

        When unpickling a NavigableString, this method is called with
        the string in DEFAULT_OUTPUT_ENCODING. That encoding needs to be
        passed in to the superclass's __new__ or the superclass won't know
        how to handle non-ASCII characters.
        (R4Rit__new__tDEFAULT_OUTPUT_ENCODING(tclstvalue((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR|�scCstj|�fS(N(R6t__str__(R!((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt__getnewargs__�scCs-|dkr|Std|jj|f�dS(s�text.string gives you text. This is for backwards
        compatibility for Navigable*String, but for CData* it lets you
        get the string without the CData wrapper.tstrings!'%s' object has no attribute '%s'N(tAttributeErrort	__class__Rs(R!tattr((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt__getattr__�scCst|�jt�S(N(RtdecodeR}(R!((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt__unicode__�scCs3|jj|j|�}|r+|j|�S|SdS(N(R{tsubRrRj(R!Rgtdata((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR��s
(RsRtR|R�R�R�R}R�(((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR6�s
					tCDatacBseZed�ZRS(cCsdtj||�S(Ns<![CDATA[%s]]>(R6R�(R!Rg((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR��s(RsRtR}R�(((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR��stProcessingInstructioncBseZed�ZRS(cCs;|}d|kr'|j||�}nd|j||�S(Ns%SOUP-ENCODING%s<?%s?>(RhRk(R!Rgtoutput((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR��s(RsRtR}R�(((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR��stCommentcBseZed�ZRS(cCsdtj||�S(Ns	<!--%s-->(R6R�(R!Rg((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR��s(RsRtR}R�(((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR��stDeclarationcBseZed�ZRS(cCsdtj||�S(Ns<!%s>(R6R�(R!Rg((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR��s(RsRtR}R�(((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR��sR\cBs�eZdZd�Zd$d$d$d�Zd�Zd�Zeee�Z	dd�Z
ee
�Zd$d�Zd�Z
d	�Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zed�Zd�Zeedd�Zd�Z ed�Z!eedd�Z"d$ie#d$d�Z$e$Z%d$ie#d$d$d�Z&e&Z'e$Z(e&Z)d$e#d$d�Z*d$e#d �Z+d!�Z,d"�Z-d#�Z.RS(%s=Represents a found HTML tag with its attributes and contents.cCs�|jd�}|jr2|tkr2tt|�S||jkr`|jrU|j|Sd|Sn�t|�dkr�|ddkr�t|�dkr�|ddkr�tt|dd��Stt|d��Sn|jr�d|Sd|Sd	S(
s�Used in a call to re.sub to replace HTML, XML, and numeric
        entities with the appropriate Unicode characters. If HTML
        entities are being converted, any unrecognized entities are
        escaped.iu&%s;it#Rqiiu&amp;%s;N(	RptconvertHTMLEntitiesRtunichrRvtconvertXMLEntitiesR8tinttescapeUnrecognizedEntities(R!tmatchRq((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt_convertEntities�s	""	cs�|j�_|j|��_|�_|dkr<g}nt|t�rZ|j�}n|�_	g�_
�j||�t�_
t�_|j�_|j�_|j�_�fd�}t|�j	��_	dS(sBasic constructor.cs(|\}}|tjd�j|�fS(Ns&(#\d+|#x[0-9a-fA-F]+|\w+);(RR�R�(t.0R
tval(R!(s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt<lambda>.s	N(R�tparserClasstisSelfClosingTagt
isSelfClosingRCRR4tdictR
RDR R"tFalsethiddentcontainsSubstitutionsR�R�R�tmap(R!tparserRCRDRRtconvert((R!s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt__init__s"						cCs:t|j�dkr6t|jdt�r6|jdSdS(Nii(R8R R4R6(R!((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt	getString4scCs|j�|j|�dS(s-Replace the contents of the tag with a stringN(tclearR@(R!R�((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt	setString9s
ucCs�t|j�sdS|j�j}g}|jd}x>||k	rut|t�ri|j|j��n|j}q8W|j|�S(Nui(	R8R R1RR4R6R@tstriptjoin(R!t	separatortstopNodetstringstcurrent((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pytgetText@s

cCs|j�j||�S(s�Returns the value of the 'key' attribute for the tag, or
        the value given for 'default' if it doesn't have that
        attribute.(t_getAttrMaptget(R!tkeytdefault((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR�NscCs#x|jD]}|j�qWdS(sExtract all children.N(R R%(R!R.((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR�TscCs@x-t|j�D]\}}||kr|SqWtd��dS(NsTag.index: element not in tag(t	enumerateR R0(R!RbRR.((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR#YscCs|j�j|�S(N(R�thas_key(R!R�((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR�_scCs|j�|S(sqtag[key] returns the value of the 'key' attribute for the tag,
        and throws an exception if it's not there.(R�(R!R�((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt__getitem__bscCs
t|j�S(s0Iterating over a tag iterates over its contents.(titerR (R!((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt__iter__gscCs
t|j�S(s:The length of a tag is the length of its list of contents.(R8R (R!((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt__len__kscCs
||jkS(N(R (R!Rq((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt__contains__oscCstS(s-A tag is non-None even if it has no contents.(R[(R!((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt__nonzero__rscCs�|j�||j|<t}xStdt|j��D]9}|j|d|kr6||f|j|<t}q6q6W|s�|jj||f�n||j�|<dS(sKSetting tag[key] sets the value of the 'key' attribute for the
        tag.iN(R�tattrMapR�trangeR8RDR[R@(R!R�RReR((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt__setitem__vs


cCsdx]|jD]R}|d|kr3|jj|�n|j�|jj|�r
|j|=q
q
WdS(s;Deleting tag[key] deletes all 'key' attributes for the tag.iN(RDtremoveR�R�R�(R!R�titem((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt__delitem__�s
cOst|j||�S(s�Calling a tag like a function is the same as calling its
        findAll() method. Eg. tag('a') returns a list of all the A tags
        found within this tag.(tapplytfindAll(R!targsRF((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt__call__�scCs~t|�dkrB|jd�t|�dkrB|j|d �S|jd�dkrd|j|�Std|j|f�dS(NiR\i����t__is!'%s' object has no attribute '%s'(R8trfindtfindR�R�(R!R?((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR��s
1
c	Cs�||krtSt|d�s|t|d�s|t|d�s||j|jks||j|jks|t|�t|�kr�tSx>tdt|j��D]$}|j||j|kr�tSq�WtS(sReturns true iff this tag has the same name, the same attributes,
        and the same contents (recursively) as the given tag.

        NOTE: right now this will return false if two tags have the
        same attributes in a different order. Should this be fixed?RCRDR i(R[R$RCRDR8R�R�R (R!totherR((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt__eq__�slcCs||kS(sZReturns true iff this tag is not identical to the other tag,
        as defined in __eq__.((R!R�((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt__ne__�scCs
|j|�S(sRenders this tag as a string.(R�(R!Rg((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt__repr__�scCs
|jd�S(N(R�R(R!((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR��sicCs�|j|j|�}g}|jrx�|jD]�\}}d}t|t�r�|jryd|kry|j||�}nd|kr�d}d|kr�|jdd�}q�n|jj	|j
|�}n|j||j||�|j||�f�q.Wnd}	d}
|jrd}	n
d	|}
d\}}|r[|}d|d}
|d}n|j
|||�}|jr�|}ng}d}|r�ddj|�}n|r�|j|
�n|jd
|||	f�|r�|jd�n|j|�|r)|r)|ddkr)|jd�n|rE|
rE|j|
�n|j|
�|rw|
rw|jrw|jd�ndj|�}|S(sReturns a string or Unicode representation of this tag and
        its contents. To get Unicode, pass None for encoding.

        NOTE: since Python's HTML parser consumes whitespace, this
        method is not certain to reproduce the whitespace present in
        the original string.s%s="%s"s%SOUP-ENCODING%Rs%s='%s'Rs&squot;ts /s</%s>it is<%s%s%s>s
i����(ii(RkRCRDR4R5R�RhRfR{R�RrR@R�trenderContentsR�R�R(R!RgtprettyPrinttindentLeveltencodedNameRDR�R�tfmttclosetcloseTagt	indentTagtindentContentstspaceR RltattributeString((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR��s^				

		

cCs�|j�t|j�dkr#dS|jd}xe|dk	r�|j}t|t�ra|j2nd|_d|_d|_	d|_d|_
|}q3WdS(s/Recursively destroys the contents of this tree.iN(R%R8R RRR4R\RRRR(R!R�R((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt	decompose
s

	
					cCs|j|t�S(N(R�R[(R!Rg((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pytprettifyscCs�g}x�|D]�}d}t|t�r:|j|�}n.t|t�rh|j|j|||��n|r�|r�|j�}n|r
|r�|jd|d�n|j|�|r�|jd�q�q
q
Wdj|�S(s{Renders the contents of this tag as a string in the given
        encoding. If encoding is None, returns a Unicode string..R�is
R�N(RR4R6R�R\R@R�R�(R!RgR�R�RltcRE((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR�!s 

cKs;d}|j||||d|�}|r7|d}n|S(sLReturn only the first child of this Tag matching the given
        criteria.iiN(RR�(R!RCRDt	recursiveRERFRURV((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR�8s

cKs7|j}|s|j}n|j||||||�S(s�Extracts a list of Tag objects that match the given
        criteria.  You can specify the name of the Tag and any
        attributes you want the Tag to have.

        The value of a key-value pair in the 'attrs' map can be a
        string, a list of strings, a regular expression object, or a
        callable that takes a string and returns whether or not the
        string matches for some custom definition of 'matches'. The
        same is true of the tag name.(trecursiveChildGeneratortchildGeneratorRH(R!RCRDR�RERJRFR`((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR�Cs	cCs|jd|d|d|�S(NRER�RJ(R�(R!RER�RJ((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt	fetchTextXscCs|jd|d|�S(NRER�(R�(R!RER�((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt	firstText[scCsIt|d�sBi|_x'|jD]\}}||j|<q"Wn|jS(s^Initializes a map representation of this tag's attributes,
        if not already initialized.R�(tgetattrR�RD(R!R�R((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR�`s
	cCs
t|j�S(N(R�R (R!((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR�jsccsYt|j�st�n|j�j}|jd}x||k	rT|V|j}q7WdS(Ni(R8R R^R1R(R!R�R�((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR�ns	
N(/RsRtRuR�RR�R�R�tpropertyR�R�RER�R�R#R�R�R�R�R�R�R�R�R�R�R�R�R}R�R�R�R�R�R�R�R[R�t	findChildR�tfindChildrentfirsttfetchR�R�R�R�R�(((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR\�sX																		T			
	RZcBsJeZdZdidd�Zd�Zdid�Zd�Zd�ZRS(sMEncapsulates a number of ways of matching a markup element (tag or
    text).cKsx||_t|t�r1t|�|d<d}n|rb|rY|j�}|j|�qb|}n||_||_dS(Ntclass(	RCR4R5RRtcopytupdateRDRE(R!RCRDRERF((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR�}s				cCs(|jr|jSd|j|jfSdS(Ns%s|%s(RERCRD(R!((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR��s	c
Csod}d}t|t�r*|}|}nt|j�oFt|t�}|js�|s�|rt|j||j�s�|rk|j||j�rk|r�|j||�}n�t}d}x�|jj�D]\}}	|st	|d�r�|}qi}x!|D]\}
}|||
<q�Wn|j
|�}|j||	�s�t}Pq�q�W|rk|r_|}qh|}qkn|S(NR�(RR4R\tcallableRCt_matchesR[RDR
R$R�R�(
R!t
markupNametmarkupAttrsRetmarkuptcallFunctionWithTagDataR�t
markupAttrMapR�tmatchAgainstR
Rt	attrValue((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt	searchTag�s>	
		cCs�d}t|d�rat|t�rax�|D].}t|t�r,|j|�r,|}Pq,q,Wn|t|t�r�|js�|j|�}q�nOt|t�s�t|t�r�|j	||j�r�|}q�nt
d|j�|S(NR�s&I don't know how to match against a %s(RR$R4R\R6R_RER�R5R�t	ExceptionR�(R!R�ReRb((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR_�s$
	
cCs=t}|tkr!|dk	}nt|�r<||�}n�t|t�rW|j}n|r|t|t�r|t|�}nt	|d�r�|o�|j
|�}n�t	|d�r�||k}nct	|d�r�|j|�}nB|r$t|t�r$t|t�rt|�}q$t|�}n|s9||k}n|S(NR�R�R
(
R�R[RR�R4R\RCR5RiR$R_R�R(R!R�R�tresult((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR��s,N(	RsRtRuRR�R�R�R_R�(((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyRZys	%	R]cBseZdZd�ZRS(sTA ResultSet is just a list that keeps track of the SoupStrainer
    that created it.cCstjg�||_dS(N(R*R�tsource(R!R�((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR��s
(RsRtRuR�(((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR]�scGs�i}x~|D]v}t|d�rLx^|j�D]\}}|||<q/Wq
t|d�ryx%|D]}|||<qbWq
|||<q
W|S(s�Turns a list of maps, lists, or scalars into a single map.
    Used to build the SELF_CLOSING_TAGS, NESTABLE_TAGS, and
    NESTING_RESET_TAGS maps out of lists and partial maps.R
R�(R$R
(R�R�tbuilttportionR
R((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pytbuildTagMap�s

tBeautifulStoneSoupc	Bs�eZdZiZiZiZiZgZej	d�d�fej	d�d�fgZ
dZdZdZ
dZeZid%d	6d%d
6d%d6d%d6d%d
6Zdd%d%ee
d%d%ed�Zd�Zd%ed�Zd�Zd�Zd�Zd�Zd�Zed�Zed�Zd�Zdd�Z d�Z!d�Z"d�Z#d�Z$d �Z%d!�Z&d"�Z'd#�Z(d$�Z)RS(&sbThis class contains the basic parser and search code. It defines
    a parser that knows nothing about tag behavior except for the
    following:

      You can't close a tag without closing all the tags it encloses.
      That is, "<foo><bar></foo>" actually means
      "<foo><bar></bar></foo>".

    [Another possible explanation is "<foo><bar /></foo>", but since
    this class defines no SELF_CLOSING_TAGS, it will never use that
    explanation.]

    This class is useful for parsing XML or made-up markup languages,
    or when BeautifulSoup makes an assumption counter to what you were
    expecting.s(<[^<>]*)/>cCs|jd�dS(Nis />(Rp(Rq((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR�(ss<!\s+([^<>]*)>cCsd|jd�dS(Ns<!iR(Rp(Rq((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR�*su
[document]thtmltxmltxhtmli	i
ii
i R�c		Cs_||_||_||_||_|jr�d|_||jkrct|_t|_	t|_
q�||jkr�t|_t|_	t|_
q�||jkr�t|_t|_	t|_
q�nt|_t|_	t|_
t
d|�|_tj|�t|d�r|j�}n||_||_y|jd|�Wntk
rQnXd|_dS(sVThe Soup object is initialized as the 'root tag', and the
        provided markup (which can be a string or a file-like object)
        is fed into the underlying parser.

        sgmllib will process most bad HTML, and the BeautifulSoup
        class has some tricks for dealing with some HTML that kills
        sgmllib, but Beautiful Soup can nonetheless choke or lose data
        if your data uses self-closing tags or declarations
        incorrectly.

        By default, Beautiful Soup uses regexes to sanitize input,
        avoiding the vast majority of these problems. If the problems
        don't apply to you, pass in False for markupMassage, and
        you'll get better performance.

        The default parser massage techniques fix the two most common
        instances of invalid HTML that choke sgmllib:

         <br/> (No space between name of closing tag and tag close)
         <! --Comment--> (Extraneous whitespace in declaration)

        You can pass in a custom list of (RE object, replace method)
        tuples to get Beautiful Soup to scrub your input the way you
        want.treadtisHTMLN(tparseOnlyThesetfromEncodingt
smartQuotesTotconvertEntitiesRt
HTML_ENTITIESR�R�R[R�R�tXHTML_ENTITIEStXML_ENTITIESR�tinstanceSelfClosingTagsRR�R$R�R�t
markupMassaget_feedtStopParsing(	R!R�RRR	RRtselfClosingTagsR((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR�;s@															
		
cCsRyt|�}Wntk
r$dSXd|ko<dknsEdS|j|�S(s/This method fixes a bug in Python's SGMLParser.Nii(R�R0tconvert_codepoint(R!RCtn((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pytconvert_charref�s
cCs4|j}t|t�r6t|d�s~d|_q~nHt||j|gd|jd|�}|j}|j|_|j	|_	|r�|j
r�t|j
d�s�|j|_
nx)|j
D]\}}|j||�}q�W|`
q�n|j
�tj||�|j�x#|jj|jkr/|j�q
WdS(NtoriginalEncodingRRR�(R�R4RiR$RRt
UnicodeDammitRRtdeclaredHTMLEncodingR	tMARKUP_MASSAGER�tresetRtfeedtendDatat
currentTagRCt
ROOT_TAG_NAMEtpopTag(R!tinDocumentEncodingRR�tdammittfixtm((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR
�s,			

cCsf|jd�s-|jd�s-|jd�r=tj||�S|jd�s\tj||�St�dS(s�This method routes method call requests to either the SGMLParser
        superclass or the Tag superclass, depending on the method name.tstart_tend_tdo_R�N(t
startswithRR�R\R�(R!t
methodName((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR��scCs"|jj|�p!|jj|�S(seReturns true iff the given string is the name of a
        self-closing tag according to this parser.(tSELF_CLOSING_TAGSR�R(R!RC((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR��scCsatj|||j�d|_tj|�g|_d|_g|_	g|_
|j|�dS(Ni(R\R�RR�RRtcurrentDataRRttagStackt
quoteStacktpushTag(R!((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR�s	
				cCs2|jj�}|jr+|jd|_n|jS(Ni����(R%tpopR(R!R?((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR�s	cCsC|jr|jjj|�n|jj|�|jd|_dS(Ni����(RR R@R%(R!R?((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR'�s	cCs+|jr'dj|j�}|j|j�dkr�tg|jD]}|j^q@�j|j�r�d|krzd}q�d}ng|_|j	r�t
|j�dkr�|j	js�|j	j|�r�dS||�}|j
|j|j�|jr||j_n||_|jjj|�ndS(NuR�s
R�i(R$R�t	translatetSTRIP_ASCII_SPACEStsetR%RCtintersectiontPRESERVE_WHITESPACE_TAGSRR8RER_R"RRRR R@(R!tcontainerClassR$R?to((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR�s&	%
			
		cCs�||jkrdSd}d}xTtt|j�ddd�D]3}||j|jkr?t|j�|}Pq?q?W|s�|d}nx#td|�D]}|j�}q�W|S(s�Pops the tag stack up to and including the most recent
        instance of the given tag. If inclusivePop is false, pops the tag
        stack up to but *not* including the most recent instqance of
        the given tag.Niii����(RRR�R8R%RCR(R!RCtinclusivePoptnumPopst
mostRecentTagR((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt	_popToTag�s&
c		Cs|jj|�}|dk}|jj|�}d}t}x�tt|j�ddd�D]�}|j|}|s�|j	|kr�|r�|}Pn|dk	r�|j	|ks�|dkr�|r�|jj|j	�r�|j	}t
}Pn|j}q\W|r|j||�ndS(s�We need to pop up to the previous tag of this type, unless
        one of this tag's nesting reset triggers comes between this
        tag and the previous tag of this type, OR unless this tag is a
        generic nesting trigger and another generic nesting trigger
        comes between this tag and the previous tag of this type.

        Examples:
         <p>Foo<b>Bar *<p>* should pop to 'p', not 'b'.
         <p>Foo<table>Bar *<p>* should pop to 'table', not 'p'.
         <p>Foo<table><tr>Bar *<p>* should pop to 'tr', not 'p'.

         <li><ul><li> *<li>* should pop to 'ul', not the first 'li'.
         <tr><table><tr> *<tr>* should pop to 'table', not the first 'tr'
         <td><tr><td> *<td>* should pop to 'tr', not the first 'td'
        iii����N(
t
NESTABLE_TAGSR�RtRESET_NESTING_TAGSR�R[R�R8R%RCR�RR3(	R!RCtnestingResetTriggerst
isNestabletisResetNestingtpopTot	inclusiveRtp((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt	_smartPops(&
	
ic
Csh|jrVdjg|D]\}}d||f^q�}|jd||f�dS|j�|j|�r�|r�|j|�n|jr�t|j�dkr�|jj	s�|jj
||�r�dSt||||j|j
�}|j
r||j
_n||_
|j|�|s,|j|�r9|j�n||jkrd|jj|�d|_n|S(NR�s %s="%s"s<%s%s>i(R&R�thandle_dataRR�R<RR8R%RER�R\RRRR'Rt
QUOTE_TAGSR@tliteral(R!RCRDtselfClosingRqtyR?((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pytunknown_starttag2s*	2
"		

cCs�|jr1|jd|kr1|jd|�dS|j�|j|�|jr�|jd|kr�|jj�t|j�dk|_ndS(Ni����s</%s>i(R&R=RR3R(R8R?(R!RC((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pytunknown_endtagPs


cCs|jj|�dS(N(R$R@(R!R�((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR=]scCs(|j�|j|�|j|�dS(sOAdds a certain piece of text to the tree as a NavigableString
        subclass.N(RR=(R!REtsubclass((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt_toStringSubclass`s

cCs-|d dkrd}n|j|t�dS(s�Handle a processing instruction as a ProcessingInstruction
        object, possibly one with a %SOUP-ENCODING% slot into which an
        encoding will be plugged later.iR�u,xml version='1.0' encoding='%SOUP-ENCODING%'N(RER�(R!RE((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt	handle_pigs	cCs|j|t�dS(s#Handle comments as Comment objects.N(RER�(R!RE((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pythandle_commentoscCs9|jrtt|��}n
d|}|j|�dS(s$Handle character references as data.s&#%s;N(RR�R�R=(R!trefR�((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pythandle_charrefss	
cCs�d}|jr:ytt|�}Wq:tk
r6q:Xn|r_|jr_|jj|�}n|r�|jr�|jj|�r�d|}n|s�d|}n|j|�dS(s�Handle entity references as data, possibly converting known
        HTML and/or XML entity references to the corresponding Unicode
        characters.s&amp;%ss&%s;N(	RR�R�RtKeyErrorR�RvR�R=(R!RHR�((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pythandle_entityref{s	


cCs|j|t�dS(s4Handle DOCTYPEs and the like as Declaration objects.N(RER�(R!R�((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pythandle_decl�scCs�d}|j||d!dkr�|jjd|�}|dkrSt|j�}n|j|d|!}|d}|j|t�nTytj||�}Wn;tk
r�|j|}|j	|�|t|�}nX|S(s`Treat a bogus SGML declaration as raw data. Treat a CDATA
        declaration as a CData object.i	s	<![CDATA[s]]>i����iN(
RtrawdataR�R8RER�Rtparse_declarationRR=(R!RtjR
R�ttoHandle((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyRN�s



N(*RsRtRuR#R4R5R>R-RRRRRRRtALL_ENTITIESRR*R[R�R�RR
R�R�RRR'R6RR3R<RBRCR=RERFRGRIRKRLRN(((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR�sN	)	C	
!	
		
			.	
						+	t
BeautifulSoupcBs=eZdZd�Zed/d0�Zedd
g�Zid/d6d/d
6Z	d1Z
d2Zigd6gd6ddgd6gd6dgd 6dgd!6Zigd"6d"d#d$d%gd&6d&gd'6d&gd(6d"gd%6d"gd#6d"gd$6Z
d3Zed/ed,eee
�Zege
eee
�Zejd-ej�Zd.�ZRS(4sThis parser knows the following facts about HTML:

    * Some tags have no closing tag and should be interpreted as being
      closed as soon as they are encountered.

    * The text inside some tags (ie. 'script') may contain tags which
      are not really part of the document and which should be parsed
      as text, not tags. If you want to parse the text as tags, you can
      always fetch it and parse it explicitly.

    * Tag nesting rules:

      Most tags can't be nested at all. For instance, the occurance of
      a <p> tag should implicitly close the previous <p> tag.

       <p>Para1<p>Para2
        should be transformed into:
       <p>Para1</p><p>Para2

      Some tags can be nested arbitrarily. For instance, the occurance
      of a <blockquote> tag should _not_ implicitly close the previous
      <blockquote> tag.

       Alice said: <blockquote>Bob said: <blockquote>Blah
        should NOT be transformed into:
       Alice said: <blockquote>Bob said: </blockquote><blockquote>Blah

      Some tags can be nested, but the nesting is reset by the
      interposition of other tags. For instance, a <tr> tag should
      implicitly close the previous <tr> tag within the same <table>,
      but not close a <tr> tag in another table.

       <table><tr>Blah<tr>Blah
        should be transformed into:
       <table><tr>Blah</tr><tr>Blah
        but,
       <tr>Blah<table><tr>Blah
        should NOT be transformed into
       <tr>Blah<table></tr><tr>Blah

    Differing assumptions about tag nesting rules are a major source
    of problems with the BeautifulSoup class. If BeautifulSoup is not
    treating as nestable a tag your page author treats as nestable,
    try ICantBelieveItsBeautifulSoup, MinimalSoup, or
    BeautifulStoneSoup before writing your own subclass.cOs@|jd�s|j|d<nt|d<tj|||�dS(NRR(R�RR[R�R�(R!R�RF((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR��s
tbrthrtinputtimgtmetatspacertlinktframetbasetcoltprettextareatscripttspantfonttqtobjecttbdoR�tsuptcentert
blockquotetdivtfieldsettinstdeltoltultlitdltddtdtttablettbodyttfootttheadttrttdtthtaddresstformR;tnoscripts((^|;)\s*charset=)([^;]*)cCs�d}d}d}t}xitdt|��D]R}||\}}|j�}|dkre|}q.|dkr.|}|}q.q.W|rT|rT|jj|�}	|	rT|jdk	s�|j|j	krd�}
|jj
|
|�}||d|f||<t}qQ|	jd�}|rQ||jkrQ||_|j
|j�t�qQqTn|jd|�}
|
r~|r~t|
_ndS(s�Beautiful Soup can detect a charset included in a META tag,
        try to convert the document to that charset, and re-parse the
        document from the beginning.is
http-equivtcontentcSs|jd�dS(Nis%SOUP-ENCODING%(Rp(R�((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pytrewriteDsiRWN(RR�R�R8tlowert
CHARSET_RER_RRRR�R[RpR
RRBR�(R!RDt	httpEquivtcontentTypetcontentTypeIndexttagNeedsEncodingSubstitutionRR�RR�R}tnewAttrt
newCharsetR?((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt
start_meta(s>	
	
			N(
sbrshrsinputRVsmetaRXslinkRZsbaseR\(sspanRaRbsobjectRdssubRescenter(RgsdivRiRjsdel(saddressRzR;spre(RsRtRuR�R�RR#R+R-R>tNESTABLE_INLINE_TAGStNESTABLE_BLOCK_TAGStNESTABLE_LIST_TAGStNESTABLE_TABLE_TAGStNON_NESTABLE_BLOCK_TAGSR5R4RRtMRR�(((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyRR�s@.		









	RcBseZRS((RsRt(((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyRWstICantBelieveItsBeautifulSoupcBs2eZdZdZdZegejee�ZRS(syThe BeautifulSoup class is oriented towards skipping over
    common HTML errors like unclosed tags. However, sometimes it makes
    errors of its own. For instance, consider this fragment:

     <b>Foo<b>Bar</b></b>

    This is perfectly valid (if bizarre) HTML. However, the
    BeautifulSoup class will implicitly close the first b tag when it
    encounters the second 'b'. It will think the author wrote
    "<b>Foo<b>Bar", and didn't close the first 'b' tag, because
    there's no real-world reason to bold something that's already
    bold. When it encounters '</b></b>' it will close two more 'b'
    tags, for a grand total of three tags closed instead of two. This
    can throw off the rest of your document structure. The same is
    true of a number of other tags, listed below.

    It's much more common for someone to forget to close a 'b' tag
    than to actually use nested 'b' tags, and the BeautifulSoup class
    handles the common case. This class handles the not-co-common
    case: where you can't believe someone wrote what they did, but
    it's valid HTML and BeautifulSoup screwed up by assuming it
    wouldn't be.temtbigRtsmallttttabbrtacronymtstrongtcitetcodetdfntkbdtsamptvartbR{(R�R�RR�sttR�R�R�R�scodeR�R�R�R�svarR�R�(snoscript(RsRtRut*I_CANT_BELIEVE_THEYRE_NESTABLE_INLINE_TAGSt)I_CANT_BELIEVE_THEYRE_NESTABLE_BLOCK_TAGSR�RRR4(((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR�ZstMinimalSoupcBs eZdZed�ZiZRS(s�The MinimalSoup class is for parsing HTML that contains
    pathologically bad markup. It makes no assumptions about tag
    nesting, but it does know which tags are self-closing, that
    <script> tags contain Javascript and should not be parsed, that
    META tags may contain encoding information, and so on.

    This also makes it better for subclassing than BeautifulStoneSoup
    or BeautifulSoup.R{(RsRtRuR�R5R4(((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR�~st
BeautifulSOAPcBseZdZd�ZRS(s�This class will push a tag with only a single string child into
    the tag's parent as an attribute. The attribute's name is the tag
    name, and the value is the string child. An example should give
    the flavor of the change:

    <foo><bar>baz</bar></foo>
     =>
    <foo bar="baz"><bar>baz</bar></foo>

    You can then access fooTag['bar'] instead of fooTag.barTag.string.

    This is, of course, useful for scraping structures that tend to
    use subelements instead of attributes, such as SOAP messages. Note
    that it modifies its input, so don't print the modified version
    out.

    I'm not sure how many people really want to use this class; let me
    know if you do. Mainly I like the name.cCs�t|j�dkr�|jd}|jd}|j�t|t�r�t|j�dkr�t|jdt�r�|jj|j	�r�|jd||j	<q�nt
j|�dS(Nii����i����i(R8R%R�R4R\R R6R�R�RCR�R(R!R?R((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR�s


$(RsRtRuR(((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR��stRobustXMLParsercBseZRS((RsRt(((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR��stRobustHTMLParsercBseZRS((RsRt(((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR��stRobustWackAssHTMLParsercBseZRS((RsRt(((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR��stRobustInsanelyWackAssHTMLParsercBseZRS((RsRt(((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR��stSimplifyingSOAPParsercBseZRS((RsRt(((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR��sRcBsbeZdZidd6dd6Zgded�Zd�Zd�Zd	�Zed
�Z	d�Z
d�ZdfZ
d
�Zi dgd6dd6dhd6did6djd6dkd6dld!6dmd$6dnd'6dod*6dpd-6dqd06drd36d4d56dsd86d4d96d4d:6dtd=6dud@6dvdC6dwdF6dxdI6dydL6dzdO6d{dR6d|dU6d}dX6d~d[6dd^6d4d_6d�db6d�de6ZRS(�s�A class for detecting the encoding of a *ML document and
    converting it to a Unicode string. If the source encoding is
    windows-1252, can replace MS smart quotes with their HTML or XML
    equivalents.s	mac-romant	macintoshs	shift-jissx-sjisR�c
Csmd|_|j||�\|_}}||_g|_|dksTt|t�rpd|_t|�|_dSd}x'|D]}|j	|�}|r}Pq}q}W|s�x0||fD]}|j	|�}|r�Pq�q�Wn|rt
rt|jt�r|j	t
j|j�d�}n|sNx*dD]}	|j	|	�}|r(Pq(q(Wn||_|sid|_ndS(NR�Rgsutf-8swindows-1252(sutf-8swindows-1252(RRt_detectEncodingR�RttriedEncodingsR4RiRt_convertFromtchardettdetect(
R!R�toverrideEncodingsRRtdocumentEncodingtsniffedEncodingtutproposedEncodingtproposed_encoding((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR��s8				
 "
	cCsV|jj|�}t|t�rR|jdkrAd|d}qRd|d}n|S(sDChanges a MS smart quote character to an XML or HTML
        entity.R�s&#x%s;is&%s;i(tMS_CHARSR�R4ttupleR(R!torigR�((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt
_subMSCharscs��j|�}|s%|�jkr)dS�jj|��j}�jr�|j�dkr�tjd�j	�fd�|�}ny(�j
||�}|�_|�_Wntk
r�}dSX�jS(Nswindows-1252s
iso-8859-1s
iso-8859-2s([�-�])cs�j|jd��S(Ni(R�Rp(Rq(R!(s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR�#s(swindows-1252s
iso-8859-1s
iso-8859-2(
t
find_codecR�RR@R�RR~RRR�t
_toUnicodeRR�(R!tproposedR�R�te((R!s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR�s$			
cCst|�dkrH|d dkrH|dd!dkrHd}|d}n�t|�dkr�|d dkr�|dd!dkr�d}|d}ni|d d	kr�d
}|d}nF|d dkr�d}|d}n#|d d
kr�d}|d}nt||�}|S(sGiven a string and its encoding, decodes the string into Unicode.
        %encoding is a string recognized by encodings.aliasesiis��tsutf-16bes��sutf-16leissutf-8t��sutf-32bes��sutf-32le(R8Ri(R!R�Rgtnewdata((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR�2s&"
"



cCsd$}}yC|d dkr/|j|�}n|d dkr`d}t|d�jd�}n�t|�dkr�|d dkr�|dd!dkr�d}t|dd�jd�}n�|d d	kr�d
}t|d
�jd�}nat|�dkrE|d dkrE|dd!dkrEd
}t|dd
�jd�}n|d dkrvd
}t|d
�jd�}n�|d dkr�d}t|d�jd�}n�|d dkr�d
}t|dd
�jd�}np|d dkrd}t|dd�jd�}n;|d dkrFd}t|dd�jd�}nd}Wn
d$}nXtjd�j|�}|r�|r�tjdtj�}|j	|�}n|d$k	r�|j
�dj�}|r�||_n|r�|d%kr�|}q�n|||fS(&s3Given a document, tries to detect its XML encoding.isLo��t<?sutf-16besutf-8is��R�s<?sutf-16les��t<sutf-32bes<sutf-32leR�s��istasciis!^<\?.*encoding=['"](.*?)['"].*\?>s#<\s*meta[^>]+charset=([^>]*?)[;'">]isiso-10646-ucs-2sucs-2t	csunicodesiso-10646-ucs-4sucs-4tcsucs4sutf-16sutf-32tutf_16tutf_32tutf16tu16N(siso-10646-ucs-2sucs-2R�siso-10646-ucs-4sucs-4R�sutf-16sutf-32sutf_16sutf_32sutf16su16(
Rt_ebcdic_to_asciiRiRjR8RRR�tIR_tgroupsR~R(R!txml_dataRtxml_encodingtsniffed_xml_encodingtxml_encoding_matchtregexp((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR�Ksj
""

	cCsd|j|jj||��pc|r?|j|jdd��pc|r`|j|jdd��pc|S(Nt-R�t_(t_codectCHARSET_ALIASESR�Rf(R!tcharset((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR��s!!cCsE|s
|Sd}ytj|�|}Wnttfk
r@nX|S(N(RtcodecstlookuptLookupErrorR0(R!R�tcodec((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR��s

cCsv|j}|jsfd}ddl}|jdjtttd���djtt|���|_n|j|j�S(Niiiii�i	i�ii�i�i�iii
iiiiiii�i�ii�iii�i�iiiii�i�i�i�i�i
iii�i�i�i�i�iiii�i�ii�i�i�i�ii�i�i�i�iii�ii i�i�i�i�i�i�i�i�i�i[i.i<i(i+i!i&i�i�i�i�i�i�i�i�i�i]i$i*i)i;i^i-i/i�i�i�i�i�i�i�i�i|i,i%i_i>i?i�i�i�i�i�i�i�i�i�i`i:i#i@i'i=i"i�iaibicidieifigihiii�i�i�i�i�i�i�ijikiliminioipiqiri�i�i�i�i�i�i�i~isitiuiviwixiyizi�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i{iAiBiCiDiEiFiGiHiIi�i�i�i�i�i�i}iJiKiLiMiNiOiPiQiRi�i�i�i�i�i�i\i�iSiTiUiViWiXiYiZi�i�i�i�i�i�i0i1i2i3i4i5i6i7i8i9i�i�i�i�i�i�i����R�i(iiiii�i	i�ii�i�i�iii
iiiiiii�i�ii�iii�i�iiiii�i�i�i�i�i
iii�i�i�i�i�iiii�i�ii�i�i�i�ii�i�i�i�iii�ii i�i�i�i�i�i�i�i�i�i[i.i<i(i+i!i&i�i�i�i�i�i�i�i�i�i]i$i*i)i;i^i-i/i�i�i�i�i�i�i�i�i|i,i%i_i>i?i�i�i�i�i�i�i�i�i�i`i:i#i@i'i=i"i�iaibicidieifigihiii�i�i�i�i�i�i�ijikiliminioipiqiri�i�i�i�i�i�i�i~isitiuiviwixiyizi�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i{iAiBiCiDiEiFiGiHiIi�i�i�i�i�i�i}iJiKiLiMiNiOiPiQiRi�i�i�i�i�i�i\i�iSiTiUiViWiXiYiZi�i�i�i�i�i�i0i1i2i3i4i5i6i7i8i9i�i�i�i�i�i�(	R�tEBCDIC_TO_ASCII_MAPR�t	maketransR�R�tchrR�R)(R!RlR�temapR�((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR��s.		<teurot20ACs�R�s�tsbquot201As�tfnoft192s�tbdquot201Es�thellipt2026s�tdaggert2020s�tDaggert2021s�tcirct2C6s�tpermilt2030s�tScaront160s�tlsaquot2039s�tOEligt152s�t?s�s#x17Dt17Ds�s�s�tlsquot2018s�trsquot2019s�tldquot201Cs�trdquot201Ds�tbullt2022s�tndasht2013s�tmdasht2014s�ttildet2DCs�ttradet2122s�tscaront161s�trsaquot203As�toeligt153s�s�s#x17Et17Es�tYumlR�s�N(seuroR�(R�R�(R�R�(R�R�(R�R�(R�R�(R�R�(R�R�(R�R�(R�R�(R�R�(R�R�(s#x17DR�(R�R�(R�R�(R�R�(R�R�(R�R�(R�R�(RR(RR(RR(RR(RR	(R
R(s#x17ER(R
R�(RsRtRuR�R�R�R�R�R�R�R�R�RR�R�R�(((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyR�sZ

!			D		
	
t__main__(?Rut
__future__Rt
__author__t__version__t
__copyright__t__license__tsgmllibRRR�t
markupbasettypesRthtmlentitydefsRtImportErrorR+t	NameErrortsetsRRttagfindR�t_declname_matchR}RRcR	RiR6R�R�R�R�R\RZR*R]R�R�RRR�RR�R�R�R�R�R�R�R�R�Rtcjkcodecs.aliasest	cjkcodecsticonv_codecRRstsyststdintsoupR�(((s3D:\Apps\Python\Hargreaves Lansdown\BeautifulSoup.pyt<module>Ns�


	�Q%��x		���$
'



�