View Single Post
Old 12-29-2019, 05:54 AM   #1
Argel
Opinionated [but right]
Argel is no ebook tyro.Argel is no ebook tyro.Argel is no ebook tyro.Argel is no ebook tyro.Argel is no ebook tyro.Argel is no ebook tyro.Argel is no ebook tyro.Argel is no ebook tyro.Argel is no ebook tyro.Argel is no ebook tyro.
 
Argel's Avatar
 
Posts: 281
Karma: 1412
Join Date: Apr 2008
Location: UK
Device: Cybook Gen3, PRS 505, Kindle Int, Oasis, Paperwhite, Scribe
remove-tags syntax

So I'm clearly getting something wrong. Every article in the London Review of Books ends with this:

*******

<div class="article-send-letter"><div class="inner"><h3><svg version="1.1" class="letters-svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 18 18" xml:space="preserve"><g class="pencil" transform="translate(7.301175, 0.000000)"><polygon fill="#494746" points="7.8,5 5.7,2.9 -0.8,9.4 1.3,11.5"></polygon><path fill="#494746" d="M7.6,1.1L6.5,2.1l2.1,2.1l1.1-1.1c0.6-0.6,0.6-1.6,0-2.1C9.1,0.4,8.2,0.4,7.6,1.1z"></path><polygon fill="#494746" points="-3,13.7 0.6,12.2 -1.5,10.1"></polygon></g><polygon fill="#494746" points="15.3,6.8 13.3,8.8 13.3,15.5 2.5,15.5 2.5,4.7 9.2,4.7 11.1,2.7 0.5,2.7 0.5,17.6 15.3,17.6 "></polygon></svg>
send letters to</h3><p>
The Editor<br>
London Review of Books<br>
28 Little Russell Street<br>
London, WC1A 2HN
<br><br><a href="mailto:letters@lrb.co.uk?subject=Letter%20to %20the%20editor&amp;body=Please%20include%20your%2 0name%2C%20address%2C%20and%20phone%20number%20so% 20that%20we%20contact%20you.">letters@lrb.co.uk</a><br><br>
Please include name, address and a telephone number
</p></div></div>

*****

I'm including the following in the script:

remove_tags = [
dict(name='div', attrs={'class' : 'article-send-letter'}),
classes('social-button article-mask lrb-readmorelink')
]

Social buttons etc are correctly removed by the 'classes' line.

However the 'dict' line, whose form was copied from the API documentation, does nothing - the 'article-send-letter' text sails straight through.

I have tried putting 'article-send-letter' into the plain list of classes but that didn't work either.

What am I doing wrong?

Argel
Argel is offline   Reply With Quote