zhihu-python icon indicating copy to clipboard operation
zhihu-python copied to clipboard

是知乎的网页结构换了吗?出现大量的NONETYPE错误

Open xxiong95 opened this issue 8 years ago • 1 comments

title = soup.find("h2", class_="zm-item-title").string.encode("utf-8").replace("\n", "") AttributeError: 'NoneType' object has no attribute 'string'

xxiong95 avatar Apr 24 '17 02:04 xxiong95

同问= = python2 test.py Traceback (most recent call last): File "test.py", line 304, in main() File "test.py", line 288, in main question_test(url) File "test.py", line 35, in question_test title = question.get_title() File "C:\Users\swanxie\Desktop\zhihu-python-master\zhihu.py", line 291, in get_title title = soup.find("h2", class_="zm-item-title").string.encode("utf-8").replace("\n", "") AttributeError: 'NoneType' object has no attribute 'string

Getitswan avatar Jun 27 '17 23:06 Getitswan