rename "section" markup

This commit is contained in:
Fabrice Laporte 2013-06-02 22:35:36 +02:00
parent 18bbe9f645
commit 09e721efe6

View file

@ -311,13 +311,11 @@ def scrape_lyrics_from_url(url):
# Simplify the code by replacing some markers by the <p> marker
try:
for tag in soup.findAll(['center', 'blockquote']):
pTag = Tag(soup, "p")
pTag.contents = tag.contents
tag.replaceWith(pTag)
for tag in soup.findAll(['center', 'blockquote','section']):
tag.name = 'p' # keep tag contents
for tag in soup.findAll(['script', 'a', 'font']):
tag.replaceWith('<p>')
tag.replaceWith('<p>') # skip tag contents
except Exception, e:
log.debug('Error %s when replacing containing marker by p marker' % e,