@@ -92,21 +92,21 @@ def get_detail(html, uid):
92
92
user .description = description .encode ('gbk' , 'ignore' ).decode ('gbk' )
93
93
elif '注册时间:' in each_str :
94
94
user .register_time = each .find (attrs = {'class' : 'pt_detail' }).get_text ().replace ('\t ' , '' ).replace (
95
- '\r \n ' , '' )
95
+ '\r \n ' , '' ). replace ( ' ' , '' )
96
96
97
97
if '标签信息' in basic_str :
98
98
basic_info = each_module .find_all (attrs = {'class' : 'li_1 clearfix' })
99
99
for each in basic_info :
100
100
if '标签:' in each .get_text ():
101
101
user .tags = each .find (attrs = {'class' : 'pt_detail' }).get_text ().replace ('\t ' , '' ).replace (
102
- '\n \n \n ' , '' ) .strip ().replace ('\r \n ' , ';' )
102
+ '\n \n \n ' , '' ) .strip ().replace ('\r \n ' , ';' ). replace ( ' ' , '' )
103
103
104
104
if '教育信息' in basic_str :
105
105
basic_info = each_module .find_all (attrs = {'class' : 'li_1 clearfix' })
106
106
for each in basic_info :
107
107
if '大学:' in each .get_text ():
108
108
user .education_info = each .find (attrs = {'class' : 'pt_detail' }).get_text ().replace ('\r \n ' , ',' ) \
109
- .replace ('\t ' , '' ).replace ('\n ' , ';' ).lstrip (';' ).rstrip (';' )
109
+ .replace ('\t ' , '' ).replace ('\n ' , ';' ).lstrip (';' ).rstrip (';' ). replace ( ' ' , '' )
110
110
111
111
if '工作信息' in basic_str :
112
112
basic_info = each_module .find_all (attrs = {'class' : 'li_1 clearfix' })
@@ -116,7 +116,7 @@ def get_detail(html, uid):
116
116
jobs = each .find_all (attrs = {'class' : 'pt_detail' })
117
117
for job in jobs :
118
118
jobs_info .append (job .get_text ().replace ('\r \n ' , '' ).replace ('\t ' , '' ).replace ('\n ' , '' ))
119
- user .work_info = ';' .join (jobs_info )
119
+ user .work_info = ';' .join (jobs_info ). replace ( ' ' , '' )
120
120
121
121
if '联系信息' in basic_str :
122
122
basic_info = each_module .find_all (attrs = {'class' : 'li_1 clearfix' })
@@ -129,7 +129,7 @@ def get_detail(html, uid):
129
129
contact_info .append ('email:' + each .find (attrs = {'class' : 'pt_detail' }).get_text ())
130
130
if 'MSN:' in each .get_text ():
131
131
contact_info .append ('msn:' + each .find (attrs = {'class' : 'pt_detail' }).get_text ())
132
- user .contact_info = ';' .join (contact_info )
132
+ user .contact_info = ';' .join (contact_info ). replace ( ' ' , '' )
133
133
except Exception as why :
134
134
print ('解析出错,具体原因为{why}' .format (why = why ))
135
135
0 commit comments