當我嘗試使用「python feedparser」時出現了一堆錯誤;而在安裝過程中沒有抱怨。 我做一些事情是這樣的:python feedparser錯誤安裝
import feedparser
url = "http://blogsearch.google.dk/blogsearch_feeds?" + \
"q=visitdenmark&output=atom"
f = feedparser.parse(url)
和錯誤:從你
f = feedparser.parse(url)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.6/dist-packages/feedparser.py", line 3798, in parse
feedparser.feed(data.decode('utf-8', 'replace'))
File "/usr/local/lib/python2.6/dist-packages/feedparser.py", line 1851, in feed
sgmllib.SGMLParser.feed(self, data)
File "/usr/lib/python2.6/sgmllib.py", line 104, in feed
self.goahead(0)
File "/usr/lib/python2.6/sgmllib.py", line 143, in goahead
k = self.parse_endtag(i)
File "/usr/lib/python2.6/sgmllib.py", line 320, in parse_endtag
self.finish_endtag(tag)
File "/usr/lib/python2.6/sgmllib.py", line 360, in finish_endtag
self.unknown_endtag(tag)
File "/usr/local/lib/python2.6/dist-packages/feedparser.py", line 659, in unknown_endtag
self.pop(prefix + suffix)
File "/usr/local/lib/python2.6/dist-packages/feedparser.py", line 868, in pop
mfresults = _parseMicroformats(output, self.baseuri, self.encoding)
File "/usr/local/lib/python2.6/dist-packages/feedparser.py", line 2412, in _parseMicroformats
p = _MicroformatsParser(htmlSource, baseURI, encoding)
File "/usr/local/lib/python2.6/dist-packages/feedparser.py", line 2016, in __init__
self.document = BeautifulSoup.BeautifulSoup(data)
AttributeError: 'module' object has no attribute 'BeautifulSoup'
聽證會,
「導入BeautifulSoup」在python控制檯中工作嗎? – 2011-02-10 17:06:36