Full stack engineer development manual ( author : Luan Peng )
python The whole course
First you need to understand python Data mining database urllib、urllib2、cookie Knowledge . Reference resources http://blog.csdn.net/luanpeng825485697/article/details/78383884
Know what needs to be set cookie Simulate login status , Need to set up http head , Meet the detection of Zhihu server .
Zhihu address https://www.zhihu.com
Visit this website when you are not logged in , Only login interface can appear
If after landing , Visit this website , There will be a list of articles .
This is because of visiting this address , The Zhihu server will query the request cookie, If you ask for cookie No user information , To prove that there was no landing , It will return to the login interface , If there is cookie The information will return to the article list interface , It also contains other information of users