Quote:
Originally Posted by Starson17
AFAIK, the order has no effect. If a tag is not in the keep list, it gets dropped (along with all of its contents).
|
Actually it does have an effect. If for example you have content like this:
PHP Code:
<div class="a"></div>
garbage
<div class="b"></div>
garbage
<div class="c"></div>
And you put in your recipe this:
Code:
keep_only_tags=[dict(name='div',attrs={'class':['c','a','b']})]
You will get this result:
Code:
<div class="c"></div>
<div class="a"></div>
<div class="b"></div>
Therefore the order is important.