1010这一行开始写关于本文件的说明与解释
1111"""
1212
13- from __future__ import print_function
13+ from __future__ import print_function , unicode_literals
1414
1515from crwy .spider import Spider
1616from crwy .exceptions import CrwyException
@@ -39,10 +39,10 @@ def login(self):
3939 password = self .password )
4040 res = self .html_downloader .download (url )
4141
42- if 'success' not in res .content :
42+ if 'success' not in res .text :
4343 raise CrwyException ("[YiMa] Login failed." )
4444
45- return res .content .strip ().split ("|" )[- 1 ]
45+ return res .text .strip ().split ("|" )[- 1 ]
4646 except Exception as e :
4747 raise CrwyException (e )
4848
@@ -65,11 +65,11 @@ def get_phone(self, token, phone_type='',
6565 phone_type = phone_type , phone = phone )
6666
6767 res = self .html_downloader .download (url )
68- if 'success' not in res .content :
68+ if 'success' not in res .text :
6969 raise CrwyException ("[YiMa] get phone failed." )
7070
71- # print(res.content )
72- return res .content .strip ().split ('|' )[- 1 ]
71+ # print(res.text )
72+ return res .text .strip ().split ('|' )[- 1 ]
7373
7474 except Exception as e :
7575 raise CrwyException (e )
@@ -88,11 +88,11 @@ def get_message(self, token, phone):
8888 phone = phone )
8989 res = self .html_downloader .download (url )
9090
91- if 'success' not in res .content :
91+ if 'success' not in res .text :
9292 raise CrwyException ("[YiMa] get message failed." )
9393
9494 else :
95- return res .content .strip ().split ('|' )[- 1 ]
95+ return res .text .strip ().split ('|' )[- 1 ]
9696
9797 except Exception as e :
9898 raise CrwyException (e )
@@ -105,7 +105,7 @@ def release_phone(self, token, phone):
105105 phone = phone )
106106 res = self .html_downloader .download (url )
107107
108- if 'success' not in res .content :
108+ if 'success' not in res .text :
109109 raise CrwyException ("[YiMa] release phone failed." )
110110
111111 except Exception as e :
@@ -119,7 +119,7 @@ def add_black(self, token, phone):
119119 phone = phone )
120120 res = self .html_downloader .download (url )
121121
122- if 'success' not in res .content :
122+ if 'success' not in res .text :
123123 raise CrwyException ("[YiMa] black phone failed." )
124124
125125 except Exception as e :
0 commit comments