Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
xxiong95 opened this issue Apr 24, 2017 · 1 comment
Open

Comments

@xxiong95
Copy link

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

@Getitswan
Copy link

同问= =
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

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

No branches or pull requests

2 participants