Skip to content
This repository has been archived by the owner on Jun 3, 2020. It is now read-only.

AttributeError: 'NoneType' object has no attribute 'text' #34

Open
optikfluffel opened this issue Sep 15, 2012 · 2 comments
Open

AttributeError: 'NoneType' object has no attribute 'text' #34

optikfluffel opened this issue Sep 15, 2012 · 2 comments

Comments

@optikfluffel
Copy link

I just tried to get rid of one of my wordpress blogs but pretty early had to stop because of this:

reading: wordpress-xml/photos.xml
Traceback (most recent call last):
  File "exitwp.py", line 292, in <module>
    data=parse_wp_xml(wpe)
  File "exitwp.py", line 127, in parse_wp_xml
    'items': parse_items(),
  File "exitwp.py", line 111, in parse_items
    'date' : gi('wp:post_date'),
  File "exitwp.py", line 91, in gi
    result=i.find(ns[namespace]+tag).text
AttributeError: 'NoneType' object has no attribute 'text'

Am I doing it wrong?

@ferbass
Copy link

ferbass commented Nov 12, 2012

I got a same error, how you solved this issue?

@mguarascio
Copy link

mguarascio commented Sep 30, 2017

It looks like this is related to the namespaces. With newer versions of wordpress blogs, these namespaces are different so exitwp.py can't find the xml elements it needs to process:

ns = {
        '':'', #this is the default namespace
        'excerpt':"{http://wordpress.org/export/1.1/excerpt/}",
        'content':"{http://purl.org/rss/1.0/modules/content/}",
        'wfw':"{http://wellformedweb.org/CommentAPI/}",
        'dc':"{http://purl.org/dc/elements/1.1/}",
        'wp':"{http://wordpress.org/export/1.1/}"
    }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants