本文整理汇总了Python中models.Profile.img_more_captions方法的典型用法代码示例。如果您正苦于以下问题:Python Profile.img_more_captions方法的具体用法?Python Profile.img_more_captions怎么用?Python Profile.img_more_captions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Profile
的用法示例。
在下文中一共展示了Profile.img_more_captions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_user_data
# 需要导入模块: from models import Profile [as 别名]
# 或者: from models.Profile import img_more_captions [as 别名]
def get_user_data(user, url, soup, br):
#logging.info('Inside get user data function')
userId = url
user_data = Profile.get_by_id(userId)
img_more = []
img_more_captions = []
# If this is a new profile
if not user_data:
#logging.info('new profile')
# Get the last online time
if soup.find('span', {'class': 'fancydate'}) != None:
last_online = soup.find('span', {'class': 'fancydate'}).text
else:
last_online = 'Online now!'
#logging.info('got the date')
# logging.info(user.key)
#logging.info(soup.prettify())
# img = str(soup.find(id='thumb0_a').find('img')['src'])
# logging.info(img)
# match = str(soup.find('span', {'class': 'match'}).text.split('%')[0])
# logging.info(match)
# friend = str(soup.find('span', {'class': 'friend'}).text.split('%')[0])
# logging.info(friend)
# enemy = str(soup.find('span', {'class': 'enemy'}).text.split('%')[0])
# logging.info(enemy)
# age = str(soup.find(id='ajax_age').text)
# logging.info(age)
# orientation = str(soup.find(id='ajax_orientation').text)
# logging.info(orientation)
# status = str(soup.find(id='ajax_status').text)
# logging.info(status)
# location = str(soup.find(id='ajax_location').text)
# logging.info(location)
# ethnicity = str(soup.find(id='ajax_ethnicities').text)
# logging.info(ethnicity)
# height = soup.find(id='ajax_height').text
# logging.info(height)
# body_type = str(soup.find(id='ajax_bodytype').text)
# logging.info(body_type)
# diet = str(soup.find(id='ajax_diet').text)
# logging.info(diet)
# smoking = str(soup.find(id='ajax_smoking').text)
# logging.info(smoking)
# drinking = str(soup.find(id='ajax_drinking').text)
# logging.info(drinking)
# drugs = str(soup.find(id='ajax_drugs').text)
# logging.info(drugs)
# religion = soup.find(id='ajax_religion').text
# logging.info(religion)
# sign = soup.find(id='ajax_sign').text
# logging.info(sign)
# education = str(soup.find(id='ajax_education').text)
# logging.info(education)
# income = soup.find(id='ajax_income').text
# logging.info(income)
# pets = soup.find(id='ajax_pets').text
# logging.info(pets)
# languages = str(soup.find(id='ajax_languages').text)
# logging.info(languages)
# essay_text_0 = unicode(soup.find(id='essay_text_0'))
# essay_text_1 = unicode(soup.find(id='essay_text_1'))
# essay_text_2 = unicode(soup.find(id='essay_text_2'))
# essay_text_3 = unicode(soup.find(id='essay_text_3'))
# essay_text_4 = unicode(soup.find(id='essay_text_4'))
# essay_text_5 = unicode(soup.find(id='essay_text_5'))
# essay_text_6 = unicode(soup.find(id='essay_text_6'))
# essay_text_7 = unicode(soup.find(id='essay_text_7'))
# essay_text_8 = unicode(soup.find(id='essay_text_8'))
# essay_text_9 = unicode(soup.find(id='essay_text_9'))
# what_i_want = unicode(soup.find(id='what_i_want'))
# logging.info(essay_text_0)
# logging.info(essay_text_1)
# logging.info(essay_text_2)
# logging.info(essay_text_3)
# logging.info(essay_text_4)
# logging.info(essay_text_5)
# logging.info(essay_text_6)
# logging.info(essay_text_7)
# logging.info(essay_text_8)
# logging.info(essay_text_9)
# logging.info(what_i_want)
# logging.info(last_online)
# logging.info([user.key])
user_data = Profile(
id = userId,
username = userId,
img = unicode(soup.find(id='thumb0_a').find('img')['src']),
match = unicode(soup.find('span', {'class': 'match'}).text.split('%')[0]),
friend = unicode(soup.find('span', {'class': 'friend'}).text.split('%')[0]),
enemy = unicode(soup.find('span', {'class': 'enemy'}).text.split('%')[0]),
age = unicode(soup.find(id='ajax_age').text),
gender = unicode(soup.find(id='ajax_gender').text),
orientation = unicode(soup.find(id='ajax_orientation').text),
status = unicode(soup.find(id='ajax_status').text),
location = unicode(soup.find(id='ajax_location').text),
ethnicity = unicode(soup.find(id='ajax_ethnicities').text),
#.........这里部分代码省略.........