How to search for a specific part of tag attribute:
Code:
dict(attrs={'someattribute':re.compile('(^|| )somestring($|| )', re.DOTALL)})
For example to remove all tags that have class Sample (along with other clases) this will do the work:
Code:
remove_tags = [
dict(attrs={'class':re.compile('(^|| )Sample($|| )', re.DOTALL)})
]