JFIF  x x C         C     "        } !1AQa "q2 #B R $3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz        w !1AQ aq"2 B #3R br $4 % &'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz   ?  N m? j EP ó Åßjc@s)dZddlZddlZejdƒZejdƒZejdƒZejdƒZejdƒZejdƒZ ejd ƒZ ejd ƒZ ejd ƒZ ejd ƒZ ejd ƒZejdejƒZejd ƒZejdƒZdefd„ƒYZdejfd„ƒYZdS(sA parser for HTML and XHTML.iÿÿÿÿNs[&<]s &[a-zA-Z#]s%&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]s)&#(?:[0-9]+|[xX][0-9a-fA-F]+)[^0-9a-fA-F]s <[a-zA-Z]s s--\s*>s$([a-zA-Z][^ />]*)(?:\s|/(?!>))*s[a-zA-Z][^ />]*s]((?<=[\'"\s/])[^\s/>][^\s/=>]*)(\s*=+\s*(\'[^\']*\'|"[^"]*"|(?![\'"])[^>\s]*))?(?:\s|/(?!>))*s <[a-zA-Z][^\t\n\r\f />\x00]* # tag name (?:[\s/]* # optional whitespace before attribute name (?:(?<=['"\s/])[^\s/>][^\s/=>]* # attribute name (?:\s*=+\s* # value indicator (?:'[^']*' # LITA-enclosed value |"[^"]*" # LIT-enclosed value |(?!['"])[^>\s]* # bare value ) )?(?:\s|/(?!>))* )* )? \s* # trailing whitespace s#tHTMLParseErrorcBs#eZdZdd„Zd„ZRS(s&Exception raised for all parse errors.cCs'||_|d|_|d|_dS(Nii(tmsgtlinenotoffset(tselfRtposition((s//opt/alt/python27/lib64/python2.7/HTMLParser.pyt__init__=s  cCsW|j}|jdk r,|d|j}n|jdk rS|d|jd}n|S(Ns , at line %ds , column %di(RRtNoneR(Rtresult((s//opt/alt/python27/lib64/python2.7/HTMLParser.pyt__str__Cs  N(NN(t__name__t __module__t__doc__RRR (((s//opt/alt/python27/lib64/python2.7/HTMLParser.pyR:s t HTMLParsercBs eZdZdZd„Zd„Zd„Zd„Zd„ZdZ d„Z d „Z d „Z d „Zd „Zd d„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZdZd„Z RS( sÇFind tags and other markup and call handler functions. Usage: p = HTMLParser() p.feed(data) ... p.close() Start tags are handled by calling self.handle_starttag() or self.handle_startendtag(); end tags by self.handle_endtag(). The data between tags is passed from the parser to the derived class by calling self.handle_data() with the data as argument (the data may be split up in arbitrary chunks). Entity references are passed by calling self.handle_entityref() with the entity reference as the argument. Numeric character references are passed to self.handle_charref() with the string containing the reference as the argument. tscripttstylecCs|jƒdS(s#Initialize and reset this instance.N(treset(R((s//opt/alt/python27/lib64/python2.7/HTMLParser.pyRcscCsSd|_d|_t|_d|_g|_d|_d|_t j j |ƒdS(s1Reset this instance. Loses all unprocessed data.ts???iiN( trawdatatlasttagtinteresting_normalt interestingRt cdata_elemt_pendingt _pending_lent_parse_thresholdt markupbaset ParserBaseR(R((s//opt/alt/python27/lib64/python2.7/HTMLParser.pyRgs       cCsã|jt|ƒ7_|j|jkr:|jj|ƒn¥|jsU|j|7_n2|jj|ƒ|jdj|jƒ7_|j2d|_t|jƒ}|jdƒt|jƒ|krÍd|_nt|jƒ|_dS(s‘Feed data to the parser. Call this as often as you want, with as little or as much text as you want (may include '\n'). RiiN(RtlenRRtappendRtjointgoahead(Rtdatatn((s//opt/alt/python27/lib64/python2.7/HTMLParser.pytfeedrs     cCsH|jr7|jdj|jƒ7_|j2d|_n|jdƒdS(sHandle any buffered data.RiiN(RRRRR (R((s//opt/alt/python27/lib64/python2.7/HTMLParser.pytclose�s   cCst||jƒƒ‚dS(N(Rtgetpos(Rtmessage((s//opt/alt/python27/lib64/python2.7/HTMLParser.pyterror˜scCs|jS(s)Return full source of start tag: '<...>'.(t_HTMLParser__starttag_text(R((s//opt/alt/python27/lib64/python2.7/HTMLParser.pytget_starttag_text�scCs2|jƒ|_tjd|jtjƒ|_dS(Ns (tlowerRtretcompiletIR(Rtelem((s//opt/alt/python27/lib64/python2.7/HTMLParser.pytset_cdata_mode¡scCst|_d|_dS(N(RRRR(R((s//opt/alt/python27/lib64/python2.7/HTMLParser.pytclear_cdata_mode¥s c Cs–|j}d}t|ƒ}x"||kr?|jj||ƒ}|rT|jƒ}n|jraPn|}||krŠ|j|||!ƒn|j||ƒ}||kr¬Pn|j}|d|ƒrct j ||ƒrè|j |ƒ}nµ|d|ƒr |j |ƒ}n”|d|ƒr*|j |ƒ}ns|d|ƒrK|j|ƒ}nR|d|ƒrl|j|ƒ}n1|d|ks‚|rœ|jdƒ|d}nP|dkrN|s³Pnt j ||ƒrÈn}|d|ƒr$|d|kr÷|jdƒqEtj ||ƒr qE|j||dƒn!|d|ƒr�|}x8dD]0} |j| |d ƒr@|t| ƒ8}Pq@q@W|j||d |!ƒn¶|d |ƒr¶|j||dƒn�|||d!jƒdkrë|j||dƒnZ|d|ƒr|j||dƒn3|d|ƒr9|j||dƒn tdƒ‚|}n|j||ƒ}q|d|ƒr3tj ||ƒ}|rî|jƒdd!} |j| ƒ|jƒ}|d|dƒsÖ|d}n|j||ƒ}qq<d||kr/|j|||d!ƒ|j||dƒ}nPq|d|ƒrtj ||ƒ}|rº|jdƒ} |j| ƒ|jƒ}|d|dƒs¢|d}n|j||ƒ}qntj ||ƒ}|r|rþ|jƒ||krþ|jdƒnPq<|d|kr8|jdƒ|j||dƒ}q<PqqW|r…||kr…|j r…|j|||!ƒ|j||ƒ}n|||_dS(Nittparse_marked_sectionR*tfindREtparse_bogus_comment(RRORtgtpos((s//opt/alt/python27/lib64/python2.7/HTMLParser.pyR@s    icCs|j}|||d!dkr0|jdƒn|jd|dƒ}|dkrVdS|rw|j||d|!ƒn|dS( Niss (Rs/>(RR(tcheck_for_whole_start_tagRttagfindR;RKRIR*RtattrfindtunescapeRtstripR%tcountRtrfindR7RCthandle_startendtagthandle_starttagtCDATA_CONTENT_ELEMENTSR/(RROtendposRtattrsR;RQttagtmtattrnametrestt attrvalueRKRR((s//opt/alt/python27/lib64/python2.7/HTMLParser.pyR<LsP     $$  cCsý|j}tj||ƒ}|rí|jƒ}|||d!}|dkrR|dS|dkr²|jd|ƒrx|dS|jd|ƒrŽdS|j||dƒ|jdƒn|dkrÂdS|d krÒdS||krâ|S|dSntd ƒ‚dS( NiRt/s/>iiÿÿÿÿsmalformed empty start tagRs6abcdefghijklmnopqrstuvwxyz=/ABCDEFGHIJKLMNOPQRSTUVWXYZswe should not get here!(RtlocatestarttagendR;RKR9R8R'RG(RRORRiRPtnext((s//opt/alt/python27/lib64/python2.7/HTMLParser.pyR\€s,        cCsj|j}tj||dƒ}|s)dS|jƒ}tj||ƒ}|s|jdk rt|j|||!ƒ|St j||dƒ}|s¿|||d!dkr¯|dS|j |ƒSn|j dƒj ƒ}|j d|jƒƒ}|j|ƒ|dS|j dƒj ƒ}|jdk rO||jkrO|j|||!ƒ|Sn|j|ƒ|jƒ|S(NiiÿÿÿÿiisR(Rt endendtagR5RKt endtagfindR;RRR7R]RVRIR*RUt handle_endtagR0(RRORR;RWt namematchttagnameR.((s//opt/alt/python27/lib64/python2.7/HTMLParser.pyR= s6     cCs!|j||ƒ|j|ƒdS(N(RdRr(RRhRg((s//opt/alt/python27/lib64/python2.7/HTMLParser.pyRcÈscCsdS(N((RRhRg((s//opt/alt/python27/lib64/python2.7/HTMLParser.pyRdÍscCsdS(N((RRh((s//opt/alt/python27/lib64/python2.7/HTMLParser.pyRrÑscCsdS(N((RRS((s//opt/alt/python27/lib64/python2.7/HTMLParser.pyRJÕscCsdS(N((RRS((s//opt/alt/python27/lib64/python2.7/HTMLParser.pyRMÙscCsdS(N((RR!((s//opt/alt/python27/lib64/python2.7/HTMLParser.pyR7ÝscCsdS(N((RR!((s//opt/alt/python27/lib64/python2.7/HTMLParser.pyRBáscCsdS(N((Rtdecl((s//opt/alt/python27/lib64/python2.7/HTMLParser.pyREåscCsdS(N((RR!((s//opt/alt/python27/lib64/python2.7/HTMLParser.pyRFéscCsdS(N((RR!((s//opt/alt/python27/lib64/python2.7/HTMLParser.pyRDìscs2d|kr|S‡fd†}tjd||ƒS(NR4cs|jƒd}yZ|ddkri|d}|dd krSt|ddƒ}n t|ƒ}t|ƒSWntk r†d|dSXtjdkrëd dl}id d 6}x-|jj ƒD]\}}t|ƒ||s(