本文整理汇总了Python中Analyzer.Analyzer.get_loan_list方法的典型用法代码示例。如果您正苦于以下问题:Python Analyzer.get_loan_list方法的具体用法?Python Analyzer.get_loan_list怎么用?Python Analyzer.get_loan_list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Analyzer.Analyzer
的用法示例。
在下文中一共展示了Analyzer.get_loan_list方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_loan_list
# 需要导入模块: from Analyzer import Analyzer [as 别名]
# 或者: from Analyzer.Analyzer import get_loan_list [as 别名]
def get_loan_list(url, cache, use_cookie=False):
""" 获取散标列表, 返回列表 """
domain = PaipaiDai.get_domain(url)
data, cache = Server.get(url, cache=cache, use_cookie=use_cookie)
if data:
data, next_page = Analyzer.get_loan_list(data)
if next_page:
next_page = os.path.join(domain, next_page.lstrip('/'))
return data, next_page, cache
return [], None, False
示例2: get_loan_all_list
# 需要导入模块: from Analyzer import Analyzer [as 别名]
# 或者: from Analyzer.Analyzer import get_loan_list [as 别名]
def get_loan_all_list(url, total_page=1):
""" 获取散标列表, 返回列表 """
domain = PaipaiDai.get_domain(url)
result = []
data, cache = Server.get(url, cache=False)
if data:
data, next_page = Analyzer.get_loan_list(data)
print url
result.extend(data)
if next_page and total_page > 1:
next_page = os.path.join(domain, next_page.lstrip('/'))
time.sleep(3)
result.extend(PaipaiDai.get_loan_list(next_page, total_page-1))
return result
示例3: __open_well_loan
# 需要导入模块: from Analyzer import Analyzer [as 别名]
# 或者: from Analyzer.Analyzer import get_loan_list [as 别名]
def __open_well_loan(url, page_count=1):
domain = PaipaiDai.get_domain(url)
data, cache = Server.get(url, cache=False, use_cookie=True)
if data:
loans, next_page = Analyzer.get_loan_list(data)
# 处理列表
for loan in loans:
if u'首次' not in loan['title'] and u'第1次' not in loan['title']:
# 过滤第一次的用户
PpOpen.analyze_loan(loan['detail_url'])
time.sleep(2)
if next_page and page_count > 0:
time.sleep(2)
next_page = os.path.join(domain, next_page.lstrip('/'))
PpOpen.open_well_loan(next_page, page_count=page_count-1)