�ɲɾ�����ӯ�����һ��ˣ��������С���˴��ͣ�������P���ҹ��ñ˽��ά�Բ��������˸߸ԣ�������ơ��ҹ��ñ�����ά�Բ���ˡ���˳^�ӣ������ӡ� ���ͯj�ӣ��ƺ���ӣ� ? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n! qap[c@s|dZdZdZdZdZdgZddlZddlZddlZddl Z ddl Z dd l m Z m Z dd lmZdd lmZmZmZmZmZmZmZmZmZmZmZd d kdefdYZeZeZdefdYZde fdYZ!de"fdYZ#e$dkrxddlZeej%Z&e&j'GHndS(sHBeautiful 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/ s*Leonard Richardson (leonardr@segfault.org)s4.6.3s*Copyright (c) 2004-2018 Leonard RichardsontMITt BeautifulSoupiNi(tbuilder_registrytParserRejectedMarkup(t UnicodeDammit( tCDatatCommenttDEFAULT_OUTPUT_ENCODINGt DeclarationtDoctypetNavigableStringt PageElementtProcessingInstructiont ResultSett SoupStrainertTags`You are trying to run the Python 2 version of Beautiful Soup under Python 3. This will not work.suYou need to convert the code, either by installing it (`python setup.py install`) or by running 2to3 (`2to3 -w bs4`).cBseZdZdZddgZdZdZdddddddZdZ d Z e d Z d Z d Zddid ZedZdZdZdZdZedZdddZdedZdZddZdZeeddZRS(s This class defines the basic interface called by the tree builders. These methods will be called by the parser: 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=NavigableString) # 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
tag), call handle_starttag and then handle_endtag. u [document]thtmltfasts sNo 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. tc sdkrtjdndkr?d=tjdndkrbd=tjdndkrd=tjdnd krd =tjd nfd }|p|d d }|p|dd}|r t|tr tjdd)}ntdkrCjj} td| n|d)kr|} t|t rp|g}n|d)kst|dkr|j }nt j |} | d)krt ddj|n| }| |jkp| |jks|jr d} nd} d)} ytjd} Wntk r<nX| rX| j}| j}ntj}d}|jd}|r|j}|jd*r|d }qn|rtd|d|d|jd| }tj|j|d d!qqn||_|j|_|j|_||j_||_ t!|d"rH|j"}nt|d#krAt|t#rud$|kst|trAd%|krAt|trt$j%j& r|j'd&}n|}t(}yt$j%j)|}Wnt*k r}nX|r1t|tr|j'd&}ntjd'|n|j+|nxh|jj,||d(|D]K\|_-|_.|_/|_0|j1y|j2PWq]t3k rq]Xq]Wd)|_-d)|j_d)S(+s_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 specific TreeBuilder to use instead of looking one up based on `features`. You shouldn't need to use this. :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 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 and there's no need to actually pass keyword arguments into the constructor. tconvertEntitiessBS4 does not respect the convertEntities argument to the BeautifulSoup constructor. Entities are always converted to Unicode characters.t markupMassagesBS4 does not respect the markupMassage argument to the BeautifulSoup constructor. The tree builder is responsible for any necessary markup massage.t smartQuotesTosBS4 does not respect the smartQuotesTo argument to the BeautifulSoup constructor. Smart quotes are always converted to Unicode characters.tselfClosingTagssBS4 does not respect the selfClosingTags argument to the BeautifulSoup constructor. The tree builder is responsible for understanding self-closing tags.tisHTMLsBS4 does not respect the isHTML argument to the BeautifulSoup constructor. Suggest you use features='lxml' for HTML and features='lxml-xml' for XML.cs<|kr8tjd||f|}|=|SdS(NsLThe "%s" argument to the BeautifulSoup constructor has been renamed to "%s."(twarningstwarntNone(told_nametnew_nametvalue(tkwargs(s0/usr/lib/python2.7/site-packages/bs4/__init__.pytdeprecated_arguments  tparseOnlyTheset parse_onlyt fromEncodingt from_encodingslYou provided Unicode markup but also provided a value for from_encoding. Your from_encoding will be ignored.is2__init__() got an unexpected keyword argument '%s'sjCouldn't find a tree builder with the features you requested: %s. Do you need to install a parser library?t,tXMLtHTMLit__file__s.pycs.pyoitfilenamet line_numbertparsert markup_typet stacklevelitreaditFssutf-8treplaces"%s" looks like a URL. Beautiful Soup is not an HTTP client. You should probably use an HTTP client like requests to get the document behind the URL, and feed that document to Beautiful Soup.(shttp:shttps:(uhttp:uhttps:(R1RNR2tanytdecodeRR(RXtspacetcant_start_withtdecoded_markup((RXs0/usr/lib/python2.7/site-packages/bs4/__init__.pyRV7s   cCsT|jj|jj|j|jx#|jj|jkrO|jq-WdS(N( RJR\tfeedRXtendDatat currentTagtnamet ROOT_TAG_NAMEtpopTag(R^((s0/usr/lib/python2.7/site-packages/bs4/__init__.pyR]Ss   cCsgtj|||j|jd|_|jjg|_d|_g|_ g|_ |j |dS(Ni( RRjRJRthiddenR\t current_dataRR}ttagStacktpreserve_whitespace_tag_stacktpushTag(R^((s0/usr/lib/python2.7/site-packages/bs4/__init__.pyR\]s      cKs)|j|td|j||||S(s+Create a new tag associated with this soup.N(tupdateRRRJ(R^R~t namespacetnsprefixtattrstkwattrs((s0/usr/lib/python2.7/site-packages/bs4/__init__.pytnew_taggs cCs ||S(s7Create a new NavigableString associated with this soup.((R^tstsubclass((s0/usr/lib/python2.7/site-packages/bs4/__init__.pyt new_stringlscCstddS(Ns4BeautifulSoup objects don't support insert_before().(tNotImplementedError(R^t successor((s0/usr/lib/python2.7/site-packages/bs4/__init__.pyt insert_beforepscCstddS(Ns3BeautifulSoup objects don't support insert_after().(R(R^R((s0/usr/lib/python2.7/site-packages/bs4/__init__.pyt insert_aftersscCs^|jj}|jr;||jdkr;|jjn|jrW|jd|_n|jS(Ni(RR5RR}(R^ttag((s0/usr/lib/python2.7/site-packages/bs4/__init__.pyRvs  cCsk|jr|jjj|n|jj||jd|_|j|jjkrg|jj|ndS(Ni(R}tcontentstappendRR~RJtpreserve_whitespace_tagsR(R^R((s0/usr/lib/python2.7/site-packages/bs4/__init__.pyRs  cCs|jrdj|j}|js{t}x'|D]}||jkr1t}Pq1q1W|r{d|krod}qxd}q{ng|_|jrt|jdkr|jj s|jj | rdS||}|j |ndS(Nus Rqi( RR;RtTruet ASCII_SPACESRSR!R3Rttexttsearchtobject_was_parsed(R^tcontainerClassRt strippabletito((s0/usr/lib/python2.7/site-packages/bs4/__init__.pyR|s&         c Cs|p |j}|p|j}d}}}t|trk|j}|j}|j}|sk|j}qkn|j |||||||_|j j ||jrt |j d}xG|dkr|j ||krPn|d8}qWt d||f|dkr|}d}n|j |d}}|t |j dkr^|j}d}n|j |d}}||_|r||_n||_|r||_n||_|r||_n||_|r||_qndS(s Add an object to the parse tree.iis[Error building tree: supposedly %r was inserted into %r after the fact, but I don't see it!N(R}t_most_recent_elementRR1Rt next_elementt next_siblingtprevious_siblingtprevious_elementtsetupRRR3RA( R^Rtparenttmost_recent_elementRRRRtindex((s0/usr/lib/python2.7/site-packages/bs4/__init__.pyRsR                cCs||jkrdSd}t|j}xnt|dddD]V}|j|}||jkr||jkr|r|j}nPn|j}q?W|S(sPops 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(RRR3RtrangeR~RtR(R^R~Rt inclusivePoptmost_recently_poppedt stack_sizeRtt((s0/usr/lib/python2.7/site-packages/bs4/__init__.pyt _popToTags c Cs|j|jrNt|jdkrN|jjsJ|jj|| rNdSt||j|||||j |j }|dkr|S|j r||j _ n||_ |j ||S(sPush a start tag on to the stack. If this method returns None, the tag was rejected by the SoupStrainer. You should proceed as if the tag had not occurred in the document. For instance, if this was a self-closing tag, don't call handle_endtag. iN( R|R!R3RRt search_tagRRRJR}RRR(R^R~RRRR((s0/usr/lib/python2.7/site-packages/bs4/__init__.pythandle_starttags      cCs|j|j||dS(N(R|R(R^R~R((s0/usr/lib/python2.7/site-packages/bs4/__init__.pyt handle_endtags cCs|jj|dS(N(RR(R^tdata((s0/usr/lib/python2.7/site-packages/bs4/__init__.pyt handle_datastminimalcCsp|jr5d}|dkr(d|}nd|}nd}|sJd}nd}|tt|j|||S(slReturns a string or Unicode representation of this document. To get Unicode, pass None for encoding.Rs encoding="%s"u uiN(R>RtsuperRRw(R^t pretty_printteventual_encodingt formattert encoding_partRtt indent_level((s0/usr/lib/python2.7/site-packages/bs4/__init__.pyRws     N( t__name__t __module__t__doc__RR8RRIRRjRmRpt staticmethodRVR]R\RR RRRRRR|RRRRRRRSRRw(((s0/usr/lib/python2.7/site-packages/bs4/__init__.pyR8s6        9   tBeautifulStoneSoupcBseZdZdZRS(s&Deprecated interface to an XML parser.cOs4d|ds2      L