Domanda

I have the feedparser.py in my project directory but my code does not work on the local google dev server for google app engine.

I get this error,

  File "/home/ahmad/GAE/livemetals/lv.py", line 34, in <module>
    d = feedparser.parse(url)
AttributeError: 'module' object has no attribute 'parse'
INFO     2012-06-23 16:13:25,891 dev_appserver.py:2891] "GET / HTTP/1.1" 500 -

this is the code i'm using

url = "http://www.mysite.com"

d = feedparser.parse(url)
articles = {}
for row in d.entries:
    temp = [row['link'].encode('utf-8'),row['title'].encode('utf-8'),row['summary'].encode('utf-8')]
    articles.append(temp)

I can use feedparser on a non-google app engine python script. However when i copy "feedparser.py" i still can't get it to work in my project even though i import it as folows

import feedparser

How do I get feedparser to work in my GAE project? thanks for the help

È stato utile?

Soluzione

It seems to me that the GAE python runtime is finding another feedparser module.
Do you have another feedparser.py script in your project?
I would try to print the feedparser.__file__ to check where the module your project is pointing to.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top