def _fix_data_select(self):
        """
        Replace all hyphens of data attributes for 'aaaaa', to avoid error in
        search.
        """

        elements = self.document.select('*')
        for element in elements:
            attributes = element.attrs.keys()
            data_attributes = list()
            for attribute in attributes:
                if bool(re.findall('^data-', attribute)):
                    data_attributes.append({
                        'original': attribute,
                        'modified': re.sub('data-', 'dataaaaaa', attribute),
                        'value': element[attribute]
                    })
            if data_attributes:
                auxiliar_element = BeautifulSoupHTMLDOMElement(element)
                for data_attribute in data_attributes:
                    auxiliar_element.remove_attribute(
                        data_attribute['original']
                    )
                    auxiliar_element.set_attribute(
                        data_attribute['modified'],
                        data_attribute['value']
                    )
def _fix_data_select ( self ) : elements = self . document . select ( '*' ) for element in elements : attributes = element . attrs . keys ( ) data_attributes = list ( ) for attribute in attributes : if bool ( re . findall ( '^data-' , attribute ) ) : data_attributes . append ( { 'original' : attribute , 'modified' : re . sub ( 'data-' , 'dataaaaaa' , attribute ) , 'value' : element [ attribute ] } ) if data_attributes : auxiliar_element = BeautifulSoupHTMLDOMElement ( element ) for data_attribute in data_attributes : auxiliar_element . remove_attribute ( data_attribute [ 'original' ] ) auxiliar_element . set_attribute ( data_attribute [ 'modified' ] , data_attribute [ 'value' ] )
Replace all hyphens of data attributes for 'aaaaa', to avoid error in
        search.