好友
阅读权限10
听众
最后登录1970-1-1
|
为什么我运行楼主的此源码,出现一下错误 我的版本是Python2.7
>>> ================================ RESTART ================================
>>>
Traceback (most recent call last):
File "C:\Python27\Python小说网.py", line 22, in <module>
soup = BeautifulSoup(res.text,'html.pars5er')
File "build\bdist.win32\egg\BeautifulSoup.py", line 1522, in __init__
BeautifulStoneSoup.__init__(self, *args, **kwargs)
File "build\bdist.win32\egg\BeautifulSoup.py", line 1147, in __init__
self._feed(isHTML=isHTML)
File "build\bdist.win32\egg\BeautifulSoup.py", line 1189, in _feed
SGMLParser.feed(self, markup)
File "C:\Python27\lib\sgmllib.py", line 104, in feed
self.goahead(0)
File "C:\Python27\lib\sgmllib.py", line 174, in goahead
k = self.parse_declaration(i)
File "build\bdist.win32\egg\BeautifulSoup.py", line 1463, in parse_declaration
j = SGMLParser.parse_declaration(self, i)
File "C:\Python27\lib\markupbase.py", line 109, in parse_declaration
self.handle_decl(data)
File "build\bdist.win32\egg\BeautifulSoup.py", line 1448, in handle_decl
self._toStringSubclass(data, Declaration)
File "build\bdist.win32\egg\BeautifulSoup.py", line 1381, in _toStringSubclass
self.endData(subclass)
File "build\bdist.win32\egg\BeautifulSoup.py", line 1251, in endData
(not self.parseOnlyThese.text or \
AttributeError: 'str' object has no attribute 'text' |
|