관리-도구
편집 파일: parser.cpython-36.opt-2.pyc
3 \AE � @ s� d dl Z d dlZd dlZd dlmZ dgZe jd�Ze jd�Ze jd�Z e jd�Z e jd�Ze jd �Ze jd �Z e jd�Ze jd�Ze jd e j�Ze jd �Ze jd�ZG dd� dej�ZdS )� N)�unescape� HTMLParserz[&<]z &[a-zA-Z#]z%&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]z)&#(?:[0-9]+|[xX][0-9a-fA-F]+)[^0-9a-fA-F]z <[a-zA-Z]�>z--\s*>z+([a-zA-Z][^\t\n\r\f />\x00]*)(?:\s|/(?!>))*z]((?<=[\'"\s/])[^\s/>][^\s/=>]*)(\s*=+\s*(\'[^\']*\'|"[^"]*"|(?![\'"])[^>\s]*))?(?:\s|/(?!>))*aF <[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*,)* # possibly followed by a comma )?(?:\s|/(?!>))* )* )? \s* # trailing whitespace z#</\s*([a-zA-Z][-.a-zA-Z0-9:_]*)\s*>c @ s� e Zd Zd9Zdd�dd�Zdd� Zd d � Zdd� Zd Zdd� Z dd� Z dd� Zdd� Zdd� Z d:dd�Zdd� Zdd� Zdd � Zd!d"� Zd#d$� Zd%d&� Zd'd(� Zd)d*� Zd+d,� Zd-d.� Zd/d0� Zd1d2� Zd3d4� Zd5d6� Zd7d8� Zd S );r �script�styleT)�convert_charrefsc C s || _ | j� d S )N)r �reset)�selfr � r �#/usr/lib64/python3.6/html/parser.py�__init__W s zHTMLParser.__init__c C s( d| _ d| _t| _d | _tjj| � d S )N� z???)�rawdata�lasttag�interesting_normal�interesting� cdata_elem�_markupbase� ParserBaser )r r r r r ` s zHTMLParser.resetc C s | j | | _ | jd� d S )Nr )r �goahead)r �datar r r �feedh s zHTMLParser.feedc C s | j d� d S )N� )r )r r r r �closeq s zHTMLParser.closeNc C s | j S )N)�_HTMLParser__starttag_text)r r r r �get_starttag_textw s zHTMLParser.get_starttag_textc C s$ |j � | _tjd| j tj�| _d S )Nz</\s*%s\s*>)�lowerr �re�compile�Ir )r �elemr r r �set_cdata_mode{ s zHTMLParser.set_cdata_modec C s t | _d | _d S )N)r r r )r r r r �clear_cdata_mode s zHTMLParser.clear_cdata_modec C sL | j }d}t|�}�x�||k �r�| jr|| j r||jd|�}|dk r�|jdt||d ��}|dkrvtjd�j ||� rvP |}n(| j j ||�}|r�|j� }n| jr�P |}||k r�| jr�| j r�| jt |||� �� n| j|||� � | j||�}||kr�P |j}|d|��rLtj||��r&| j|�} n�|d|��r>| j|�} nl|d|��rV| j|�} nT|d|��rn| j|�} n<|d |��r�| j|�} n$|d |k �r�| jd� |d } nP | dk �r>|�s�P |jd|d �} | dk �r�|jd|d �} | dk �r|d } n| d 7 } | j�r,| j �r,| jt ||| � �� n| j||| � � | j|| �}q|d|��r�tj||�}|�r�|j� d d� } | j| � |j� } |d| d ��s�| d } | j|| �}qn:d||d � k�r�| j|||d � � | j||d �}P q|d|�rtj||�}|�rN|jd �} | j| � |j� } |d| d ��s@| d } | j|| �}qtj||�}|�r�|�r�|j� ||d � k�r�|j� } | |k�r�|} | j||d �}P n,|d |k �r�| jd� | j||d �}nP qqW |�r:||k �r:| j �r:| j�r| j �r| jt |||� �� n| j|||� � | j||�}||d � | _ d S )Nr �<�&�"