This commit is contained in:
Sven Slootweg 2014-02-04 19:53:05 +01:00
parent 3db03618e0
commit b17347c166

View file

@ -70,7 +70,11 @@ print "Parsing XML..."
for item in xml.xpath("/rss/channel/item"): for item in xml.xpath("/rss/channel/item"):
post_type = item.xpath("wp:post_type/text()", namespaces=xmlns)[0] post_type = item.xpath("wp:post_type/text()", namespaces=xmlns)[0]
try:
post_title = item.xpath("title/text()", namespaces=xmlns)[0] post_title = item.xpath("title/text()", namespaces=xmlns)[0]
except IndexError, e:
post_title = "Untitled"
try: try:
post_slug = item.xpath("wp:post_name/text()", namespaces=xmlns)[0] post_slug = item.xpath("wp:post_name/text()", namespaces=xmlns)[0]