Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of github.com:mitsuhiko/brink-aggregator

  • Loading branch information...
commit 4f3a5cdbf9f580efcbf08d1b5009478201ce144f 2 parents ec5e09c + 74b8431
@mitsuhiko authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 brink.py
View
6 brink.py
@@ -15,6 +15,7 @@
import cookielib
import html5lib
import logging
+from lxml import etree
from twitter_text import TwitterText
from datetime import datetime, timedelta
from urlparse import urljoin
@@ -388,6 +389,8 @@ def move_table_contents_out(node):
parent.remove(node)
def transform(node):
+ if node.tag is etree.Comment:
+ return node
if '}' in node.tag:
node.tag = node.tag.split('}')[-1]
if node.tag == 'a':
@@ -407,7 +410,8 @@ def transform(node):
node.attrib.pop('cellspacing', None)
elif node.tag == 'div':
if node.getchildren():
- div_children = node.getchildren()
+ div_children = [x for x in node.getchildren()
+ if x.tag is not etree.Comment]
if len(div_children) >= 2 and \
div_children[0].tag.split('}')[-1] == 'div' and \
div_children[0].text and \

0 comments on commit 4f3a5cd

Please sign in to comment.
Something went wrong with that request. Please try again.