Beispiel #1
0
def get_suning_detail(response):
    log_page(response, 'get_suning_detail.html')
    html = Selector(response)

    # app_channel = 'suning'
    apk_name = response.meta['apk_name']
    app_channel = response.meta['app_channel']
    app_name = html.xpath('//dl[@class="detail-top fl"]/dd/h3/text()').extract()[0]
    app_link = html.xpath('//a[@class="dl2pc-btn"]/@href').extract()[0]
    app_pn = response.url.split('pack=')[1]
    app_version = html.xpath('//a[@class="vers"]/span/text()').extract()[0]
    app_size = ''
    save_dir = os.path.sep.join([APK_DOWNLOAD_DIR, apk_name])


    params_dic = {} # 参数字典
    params_dic['app_channel'] = app_channel     # 渠道
    params_dic['app_link'] = app_link           # apk下载链接
    params_dic['save_dir'] = save_dir           # 下载apk保存的目录
    params_dic['app_name'] = app_name           # 要下载的apk的应用名称
    params_dic['app_pn'] = app_pn               # apk包名
    params_dic['app_version'] = app_version     # apk版本号
    params_dic['app_size'] = app_size           # apk文件的大小

    return download(**params_dic)
Beispiel #2
0
def get_sina_detail(response):
    log_page(response, 'get_sina_detail.html')
    html = Selector(response)

    # app_channel = 'sina'
    apk_name = response.meta['apk_name']
    app_channel = response.meta['app_channel']
    app_name = html.xpath('//div[@class="tit_01"]/h2/text()').extract()[0]
    ip = get_ip()
    app_link = 'http://down.tech.sina.com.cn' + html.xpath('//*[@id="downurl_link"]/@href').extract()[0]
    print app_link,'11111111111111111111111------------------'
    app_pn = ''
    app_version = html.xpath('//ul[@class="zcwords  clearfix"]/li[2]/p[1]/text()').extract()[0].split(u':')[1]
    app_size = ''
    save_dir = os.path.sep.join([APK_DOWNLOAD_DIR, apk_name])
    app_download_times = html.xpath()('//ul[@class="zcwords  clearfix"]/li[7]/text()').extract()[0].split(u'总计:')[1]


    params_dic = {} # 参数字典
    params_dic['app_channel'] = app_channel     # 渠道
    params_dic['app_detail_url'] = response.url # apk下载页面
    params_dic['app_download_times'] = app_download_times  # apk下载次数
    params_dic['app_link'] = app_link           # apk下载链接
    params_dic['save_dir'] = save_dir           # 下载apk保存的目录
    params_dic['app_name'] = app_name           # 要下载的apk的应用名称
    params_dic['app_pn'] = app_pn               # apk包名
    params_dic['app_version'] = app_version     # apk版本号
    params_dic['app_size'] = app_size           # apk文件的大小

    yield Request(app_link, meta={'params_dic': params_dic}, callback=get_app_download_link)
Beispiel #3
0
def get_suning_detail(response):
    log_page(response, 'get_suning_detail.html')
    html = Selector(response)

    # app_channel = 'suning'
    apk_name = response.meta['apk_name']
    app_channel = response.meta['app_channel']
    app_name = html.xpath(
        '//dl[@class="detail-top fl"]/dd/h3/text()').extract()[0]
    app_link = html.xpath('//a[@class="dl2pc-btn"]/@href').extract()[0]
    app_pn = response.url.split('pack=')[1]
    app_version = html.xpath('//a[@class="vers"]/span/text()').extract()[0]
    app_size = ''
    save_dir = os.path.sep.join([APK_DOWNLOAD_DIR, apk_name])
    app_download_times = html.xpath(
        '//dl[@class="detail-main clearfix"]/dd[1]/p[2]/span/text()').extract(
        )[0]

    params_dic = {}  # 参数字典
    params_dic['app_channel'] = app_channel  # 渠道
    params_dic['app_detail_url'] = response.url  # apk下载页面
    params_dic['app_download_times'] = app_download_times  # apk下载次数
    params_dic['app_link'] = app_link  # apk下载链接
    params_dic['save_dir'] = save_dir  # 下载apk保存的目录
    params_dic['app_name'] = app_name  # 要下载的apk的应用名称
    params_dic['app_pn'] = app_pn  # apk包名
    params_dic['app_version'] = app_version  # apk版本号
    params_dic['app_size'] = app_size  # apk文件的大小

    return download(**params_dic)
Beispiel #4
0
def get_yiyonghui_detail(response):
    log_page(response, 'get_yiyonghui_detail.html')
    html = Selector(response)

    # app_channel = 'yiyonghui'
    app_channel = response.meta['app_channel']
    apk_name = response.meta['apk_name']

    app_name = apk_name
    app_link = 'http://www.anzhuoapk.com' + html.xpath('//div[@class="content1_bottom"]/a[1]/@href').extract()[0]
    app_pn = ''
    app_version = ''
    app_size = ''
    save_dir = os.path.sep.join([APK_DOWNLOAD_DIR, apk_name])


    params_dic = {} # 参数字典
    params_dic['app_channel'] = app_channel     # 渠道
    params_dic['app_link'] = app_link           # apk下载链接
    params_dic['save_dir'] = save_dir           # 下载apk保存的目录
    params_dic['app_name'] = app_name           # 要下载的apk的应用名称
    params_dic['app_pn'] = app_pn               # apk包名
    params_dic['app_version'] = app_version     # apk版本号
    params_dic['app_size'] = app_size           # apk文件的大小

    return download(**params_dic)
Beispiel #5
0
def get_sina_detail(response):
    log_page(response, 'get_sina_detail.html')
    html = Selector(response)

    # app_channel = 'sina'
    apk_name = response.meta['apk_name']
    app_channel = response.meta['app_channel']
    app_name = html.xpath('//div[@class="tit_01"]/h2/text()').extract()[0]
    ip = get_ip()
    app_link = 'http://down.tech.sina.com.cn' + html.xpath('//*[@id="downurl_link"]/@href').extract()[0]
    print app_link,'11111111111111111111111------------------'
    app_pn = ''
    app_version = html.xpath('//ul[@class="zcwords  clearfix"]/li[2]/p[1]/text()').extract()[0].split(u':')[1]
    app_size = ''
    save_dir = os.path.sep.join([APK_DOWNLOAD_DIR, apk_name])

    params_dic = {} # 参数字典
    params_dic['app_channel'] = app_channel     # 渠道
    params_dic['app_link'] = app_link           # apk下载链接
    params_dic['save_dir'] = save_dir           # 下载apk保存的目录
    params_dic['app_name'] = app_name           # 要下载的apk的应用名称
    params_dic['app_pn'] = app_pn               # apk包名
    params_dic['app_version'] = app_version     # apk版本号
    params_dic['app_size'] = app_size           # apk文件的大小

    yield Request(app_link, meta={'params_dic': params_dic}, callback=get_app_download_link)
Beispiel #6
0
def get_yiyonghui_detail(response):
    log_page(response, 'get_yiyonghui_detail.html')
    html = Selector(response)

    # app_channel = 'yiyonghui'
    app_channel = response.meta['app_channel']
    apk_name = response.meta['apk_name']

    app_name = apk_name
    app_link = 'http://www.anzhuoapk.com' + html.xpath(
        '//div[@class="content1_bottom"]/a[1]/@href').extract()[0]
    app_pn = ''
    app_version = ''
    app_size = ''
    save_dir = os.path.sep.join([APK_DOWNLOAD_DIR, apk_name])
    app_download_times = html.xpath(
        '//div[@class="ctxt"]/span[4]/text()').extract()[0].split(u':')[1]

    params_dic = {}  # 参数字典
    params_dic['app_channel'] = app_channel  # 渠道
    params_dic['app_detail_url'] = response.url  # apk下载页面
    params_dic['app_download_times'] = app_download_times  # apk下载次数
    params_dic['app_link'] = app_link  # apk下载链接
    params_dic['save_dir'] = save_dir  # 下载apk保存的目录
    params_dic['app_name'] = app_name  # 要下载的apk的应用名称
    params_dic['app_pn'] = app_pn  # apk包名
    params_dic['app_version'] = app_version  # apk版本号
    params_dic['app_size'] = app_size  # apk文件的大小

    return download(**params_dic)
Beispiel #7
0
def get_aliexpress_detail(response):
    log_page(response, 'get_aliexpress_detail.html')
    html = Selector(response)
    urls = html.xpath('//div[@class="press-area-wrap"]/a/@href').extract()

    for u in urls:
        yield Request(u, callback=get_detail_page)
Beispiel #8
0
def get_aliexpress_detail(response):
    log_page(response, 'get_aliexpress_detail.html')
    html = Selector(response)
    urls = html.xpath('//div[@class="press-area-wrap"]/a/@href').extract()

    for u in urls:
        yield Request(u, callback=get_detail_page)
Beispiel #9
0
def get_anqi_detail(response):
    log_page(response, 'get_anqi_detail.html')
    html = Selector(response)

    # app_channel = 'anqi'
    app_channel = response.meta['app_channel']
    apk_name = response.meta['apk_name']
    app_name = apk_name

    try:
        toget_app_link = 'http://www.apkcn.com' + html.xpath('//div[@class="imginfo"]/p[2]/a/@href').extract()[0]
    except:
        ## xpath有误。
        add_error_app_info(app_channel, app_name, '0')
        yield None

    app_link = ''
    app_pn = ''
    app_version = ''
    app_size = ''
    save_dir = os.path.sep.join([APK_DOWNLOAD_DIR, apk_name])


    params_dic = {} # 参数字典
    params_dic['app_channel'] = app_channel     # 渠道
    params_dic['app_link'] = app_link           # apk下载链接
    params_dic['save_dir'] = save_dir           # 下载apk保存的目录
    params_dic['app_name'] = app_name           # 要下载的apk的应用名称
    params_dic['app_pn'] = app_pn               # apk包名
    params_dic['app_version'] = app_version     # apk版本号
    params_dic['app_size'] = app_size           # apk文件的大小

    yield Request(toget_app_link, meta={'params_dic': params_dic},
                  callback=get_app_link)
Beispiel #10
0
def get_android155_detail(response):
    log_page(response, 'get_android155_detail.html')
    html = Selector(response)

    # app_channel = 'android155'
    app_channel = response.meta['app_channel']
    apk_name = response.meta['apk_name']
    app_name = apk_name
    try:
        app_link = html.xpath('//*[@id="client_list"]/a/@href').extract()[0]
    except:
        ## xpath有误。
        add_error_app_info(app_channel, app_name, '0')
        return None

    app_pn = ''
    app_version = ''
    app_size = ''
    save_dir = os.path.sep.join([APK_DOWNLOAD_DIR, apk_name])
    app_download_times = ''

    params_dic = {}  # 参数字典
    params_dic['app_channel'] = app_channel  # 渠道
    params_dic['app_detail_url'] = response.url  # apk下载页面
    params_dic['app_download_times'] = app_download_times  # apk下载次数
    params_dic['app_link'] = app_link  # apk下载链接
    params_dic['save_dir'] = save_dir  # 下载apk保存的目录
    params_dic['app_name'] = app_name  # 要下载的apk的应用名称
    params_dic['app_pn'] = app_pn  # apk包名
    params_dic['app_version'] = app_version  # apk版本号
    params_dic['app_size'] = app_size  # apk文件的大小

    return download(**params_dic)
Beispiel #11
0
def get_aliexpress_activity(response):
    log_page(response, 'get_aliexpress_activity.html')
    html = Selector(response)

    activity = html.xpath(
        '//*[@id="key-visual-main"]/div/div/ul/li[2]/a/@href').extract()[0]
    yield Request(activity, callback=get_aliexpress_detail)
Beispiel #12
0
def get_anruan_detail(response):
    log_page(response, 'get_anruan_detail.html')
    html = Selector(response)

    # app_channel = 'anruan'
    app_channel = response.meta['app_channel']
    apk_name = response.meta['apk_name']
    app_name = apk_name
    try:
        app_link = html.xpath('//li[@class="app_down"]/a/@href').extract()[0]
    except:
        ## xpath有误。
        add_error_app_info(app_channel, app_name, '0')
        return None

    app_pn = ''
    app_version = ''
    app_size = ''
    save_dir = os.path.sep.join([APK_DOWNLOAD_DIR, apk_name])


    params_dic = {} # 参数字典
    params_dic['app_channel'] = app_channel     # 渠道
    params_dic['app_link'] = app_link           # apk下载链接
    params_dic['save_dir'] = save_dir           # 下载apk保存的目录
    params_dic['app_name'] = app_name           # 要下载的apk的应用名称
    params_dic['app_pn'] = app_pn               # apk包名
    params_dic['app_version'] = app_version     # apk版本号
    params_dic['app_size'] = app_size           # apk文件的大小

    return download(**params_dic)
Beispiel #13
0
def todownload(response):
    log_page(response, 'get_app_download_times.html')
    # p = re.compile("document.write\('(.*?)'\)")
    # count = re.search(p, response.body)
    count = response.body.split("'")[1]

    params_dic = response.meta
    params_dic['app_download_times'] = count
    return download(**params_dic)
Beispiel #14
0
def get_detail_page(response):
    log_page(response, response.url[-8:]+'.html')
    html = Selector(response)

    price = html.xpath('//span[@id="sku-discount-price"]/text()').extract()
    print price,'-----'

    score = html.xpath('//div[@class="seller-score"]/a[@class="seller-score-lnk"]/b/text()').extract()

    print score,'====='
Beispiel #15
0
def get_detail_page(response):
    log_page(response, response.url[-8:] + '.html')
    html = Selector(response)

    price = html.xpath('//span[@id="sku-discount-price"]/text()').extract()
    print price, '-----'

    score = html.xpath(
        '//div[@class="seller-score"]/a[@class="seller-score-lnk"]/b/text()'
    ).extract()

    print score, '====='
Beispiel #16
0
def get_sina_android_list(response):
    log_page(response, 'get_sina_android_list.html')

    url_list_xpath = '/html/body/div/div/h3/a/@href'
    name_list_xpath = '/html/body/div/div/h3/a/text()'
    func = get_sina_detail
    host = 'http://down.tech.sina.com.cn'
    result = get_search_list(response, url_list_xpath, name_list_xpath, func, host)
    if type(result) == list:
        for r in result:
            yield r
    else:
        yield result
Beispiel #17
0
def get_android155_search_list(response):
    log_page(response, 'get_android155_search_list.html')

    url_list_xpath = '//*[@id="search"]/div[2]/ul/li/strong/a/@href'
    name_list_xpath = '//*[@id="search"]/div[2]/ul/li/strong/a/text()'
    func = get_android155_detail
    host = 'http://www.android.155.cn'
    result = get_search_list(response, url_list_xpath, name_list_xpath, func, host)
    if type(result) == list:
        for r in result:
            yield r
    else:
        yield result
Beispiel #18
0
def get_apkke_search_list(response):
    log_page(response, 'get_apkke_search_list.html')

    url_list_xpath = '//ul[@class="soft-list"]/li/h2/a/@href'
    name_list_xpath = '//ul[@class="soft-list"]/li/h2/a/font/font/text()'
    func = get_apkke_detail
    host = 'http://www.apkke.com'
    result = get_search_list(response, url_list_xpath, name_list_xpath, func, host)
    if type(result) == list:
        for r in result:
            yield r
    else:
        yield result
Beispiel #19
0
def get_suning_search_list(response):
    log_page(response, 'get_suning_search_list.html')

    url_list_xpath = '//div[@class="app-result"]/ul/li/dl/dd/div/h3/a/@href'
    name_list_xpath = '//div[@class="app-result"]/ul/li/dl/dd/div/h3/a/text()'
    func = get_suning_detail
    host = ''
    result = get_search_list(response, url_list_xpath, name_list_xpath, func, host)
    if type(result) == list:
        for r in result:
            yield r
    else:
        yield result
Beispiel #20
0
def get_anruan_search_list(response):
    log_page(response, 'get_anruan_search_list.html')

    url_list_xpath = '//div[@id="divlist"]/div[@class="li"]/ul/li/a/@href'
    name_list_xpath = '//div[@id="divlist"]/div[@class="li"]/ul/li/a/@title'
    func = get_anruan_detail
    host = ''
    result = get_search_list(response, url_list_xpath, name_list_xpath, func, host)
    if type(result) == list:
        for r in result:
            yield r
    else:
        yield result
Beispiel #21
0
def get_anqi_search_list(response):
    log_page(response, 'get_anqi_search_list.html')

    url_list_xpath = '//div[@class="posts psiosnews"]/div[@class="box"]/div/h3/a/@href'
    name_list_xpath = '//div[@class="posts psiosnews"]/div[@class="box"]/div/h3/a/@title'
    func = get_anqi_detail
    host = 'http://www.apkcn.com'
    result = get_search_list(response, url_list_xpath, name_list_xpath, func, host)
    if type(result) == list:
        for r in result:
            yield r
    else:
        yield result
Beispiel #22
0
def get_sina_android_list(response):
    log_page(response, 'get_sina_android_list.html')

    url_list_xpath = '/html/body/div/div/h3/a/@href'
    name_list_xpath = '/html/body/div/div/h3/a/text()'
    func = get_sina_detail
    host = 'http://down.tech.sina.com.cn'
    result = get_search_list(response, url_list_xpath, name_list_xpath, func, host)
    if type(result) == list:
        for r in result:
            yield r
    else:
        yield result
Beispiel #23
0
def get_yiyonghui_search_list(response):
    log_page(response, 'get_yiyonghui_search_list.html')

    url_list_xpath = '//div[@class="app_all_list"]/dl/dd/div[@class="app_txt z"]/p[1]/a/@href'
    name_list_xpath = '//div[@class="app_all_list"]/dl/dd/div[@class="app_txt z"]/p[1]/a/text()'
    func = get_yiyonghui_detail
    host = ''
    result = get_search_list(response, url_list_xpath, name_list_xpath, func, host)
    if type(result) == list:
        for r in result:
            yield r
    else:
        yield result
Beispiel #24
0
def get_anruan_search_list(response):
    log_page(response, 'get_anruan_search_list.html')

    url_list_xpath = '//div[@id="divlist"]/div[@class="li"]/ul/li/a/@href'
    name_list_xpath = '//div[@id="divlist"]/div[@class="li"]/ul/li/a/@title'
    func = get_anruan_detail
    host = ''
    result = get_search_list(response, url_list_xpath, name_list_xpath, func, host)
    if type(result) == list:
        for r in result:
            yield r
    else:
        yield result
Beispiel #25
0
def get_suning_search_list(response):
    log_page(response, 'get_suning_search_list.html')

    url_list_xpath = '//div[@class="app-result"]/ul/li/dl/dd/div/h3/a/@href'
    name_list_xpath = '//div[@class="app-result"]/ul/li/dl/dd/div/h3/a/text()'
    func = get_suning_detail
    host = ''
    result = get_search_list(response, url_list_xpath, name_list_xpath, func,
                             host)
    if type(result) == list:
        for r in result:
            yield r
    else:
        yield result
Beispiel #26
0
def get_android155_search_list(response):
    log_page(response, 'get_android155_search_list.html')

    url_list_xpath = '//*[@id="search"]/div[2]/ul/li/strong/a/@href'
    name_list_xpath = '//*[@id="search"]/div[2]/ul/li/strong/a/text()'
    func = get_android155_detail
    host = 'http://www.android.155.cn'
    result = get_search_list(response, url_list_xpath, name_list_xpath, func,
                             host)
    if type(result) == list:
        for r in result:
            yield r
    else:
        yield result
Beispiel #27
0
def get_yiyonghui_search_list(response):
    log_page(response, 'get_yiyonghui_search_list.html')

    url_list_xpath = '//div[@class="app_all_list"]/dl/dd/div[@class="app_txt z"]/p[1]/a/@href'
    name_list_xpath = '//div[@class="app_all_list"]/dl/dd/div[@class="app_txt z"]/p[1]/a/text()'
    func = get_yiyonghui_detail
    host = ''
    result = get_search_list(response, url_list_xpath, name_list_xpath, func,
                             host)
    if type(result) == list:
        for r in result:
            yield r
    else:
        yield result
Beispiel #28
0
def get_app_link(response):
    log_page(response, 'get_anqi_app_link.html')
    html = Selector(response)
    params_dic = response.meta['params_dic']

    try:
        app_link = html.xpath('//div[@class="dadadd"]/a/@href').extract()[0]
    except:
        ## xpath有误。
        add_error_app_info(params_dic['app_channel'], params_dic['app_name'], '0')
        return None

    params_dic['app_link'] = app_link

    return download(**params_dic)
Beispiel #29
0
def get_apkke_detail(response):
    log_page(response, 'get_apkke_detail.html')
    html = Selector(response)

    # app_channel = 'apkke'
    app_channel = response.meta['app_channel']
    apk_name = response.meta['apk_name']
    app_name = apk_name
    try:
        app_link = 'http://www.apkke.com' + html.xpath('//*[@id="down-btn"]/li[1]/a/@href').extract()[0]
    except:
        ## xpath有误。
        add_error_app_info(app_channel, app_name, '0')
        return None

    app_pn = ''
    app_version = ''
    app_size = ''
    save_dir = os.path.sep.join([APK_DOWNLOAD_DIR, apk_name])
    app_download_times = ''
    app_download_times_js_src = 'http://www.apkke.com/plus/disdls.php?aid=' + response.url[response.url.rfind('/')+1: response.url.rfind('.')]



    params_dic = {} # 参数字典
    params_dic['app_channel'] = app_channel     # 渠道
    params_dic['app_detail_url'] = response.url # apk下载页面
    params_dic['app_download_times'] = app_download_times  # apk下载次数
    params_dic['app_link'] = app_link           # apk下载链接
    params_dic['save_dir'] = save_dir           # 下载apk保存的目录
    params_dic['app_name'] = app_name           # 要下载的apk的应用名称
    params_dic['app_pn'] = app_pn               # apk包名
    params_dic['app_version'] = app_version     # apk版本号
    params_dic['app_size'] = app_size           # apk文件的大小

    return Request(app_download_times_js_src, meta=params_dic, callback=todownload)
Beispiel #30
0
def get_yingyongbao_search_list(response):
    log_page(response, 'get_yingyongbao_search_list.html')
    # 应用宝是异步获取json格式的数据。
    data = json.loads(response.body)
    # 获取列表第一条数据
    """
    {"description":"招商银行手机银行3.0全新升级,闪耀登场。完美适配2K大屏安卓手机,包含68项功能更新,为您打造更加专业、简单、安全的移动互联新生活!\r\n
    时代在变,从未改变的是因您而变!\r\n
    六大特性,满足最挑剔的你:\r\n
    ★转账免费:即日起至2015年底,转账0费用,每日高达20万元的转账汇款额度;使用优KEY转账,每日额度更可高至50万元!\r\n
    ★智能金融:账户总览,轻松管理名下所有资产;理财日历,金融琐事智能提醒。\r\n
    ★生活助手:掌上商城、话费充值、商旅预订、彩票投注、电影票在线选座等,是您贴心生活的好助手!\r\n
    ★还款快捷:信用卡账单随查随还,额度实时恢复,更支持中、农、建等多家银行借记卡免手续费还款!\r\n
    ★理财专享:手机银行客户独享专属高收益理财产品。更有专属日日盈产品,满足对流动性有更高要求的您。\r\n
    ★安全无忧:秉承业界最高安全标准,除采用SSL加密通信协议确保数据全程加密,登录IP变动检测、转账额度自主设置等安全措施外、同时增加登录密码键盘加密机制、用户自定义手机银行后台在线等多种防护措施。在涉及用户资金安全的交易中,短信验证码验证用户身份,时刻保障客户资金安全。",
    "flag":16469,
    "fileSize":5424478,
    "authorId":598794,
    "categoryId":107,
    "pkgName":"cmb.pb",
    "appId":6504,
    "appName":"招商银行",
    "apkUrl":"http://dd.myapp.com/16891/FCA4290E1CE5B7A5B2ACFF83AD156BA1.apk?fsname=cmb.pb_3.1.0_310.apk&asr=8eff",
    "versionCode":310,
    "iconUrl":"http://pp.myapp.com/ma_icon/0/icon_6504_21035686_1430874297/96",
    "versionName":"3.1.0",
    "appDownCount":7291974,
    "averageRating":3.5436363636363635,
    "editorIntro":"招商银行,您的贴身金融管家",
    "categoryName":"生活",
    "images":["http://pp.myapp.com/ma_pic2/0/shot_6504_21035686_1_1430874294/550",
              "http://pp.myapp.com/ma_pic2/0/shot_6504_21035686_2_1430874294/550",
              "http://pp.myapp.com/ma_pic2/0/shot_6504_21035686_3_1430874294/550",
              "http://pp.myapp.com/ma_pic2/0/shot_6504_21035686_4_1430874294/550",
              "http://pp.myapp.com/ma_pic2/0/shot_6504_21035686_5_1430874294/550"],
    "apkMd5":"FCA4290E1CE5B7A5B2ACFF83AD156BA1",
    "authorName":"招商银行股份有限公司",
    "apkPublishTime":1430874299,
    "appRatingInfo":{"averageRating":3.5436363636363635,"ratingCount":550,"ratingDistribution":{"1":147,"2":30,"3":37,"4":49,"5":287}}}
    """
    i = data['obj']['appDetails'][0]
    app_name = i['appName']

    apk_name = response.meta['apk_name']

    if app_name.encode('utf8') != apk_name:
        return None

    app_pn = i['pkgName']
    app_link = i['apkUrl']
    app_version = i['versionName']
    app_size = i['fileSize']
    # app_channel = 'yingyongbao'
    app_channel = response.meta['app_channel']
    save_dir = os.path.sep.join([APK_DOWNLOAD_DIR, apk_name])

    params_dic = {} # 参数字典
    params_dic['app_channel'] = app_channel     # 渠道
    params_dic['app_link'] = app_link           # apk下载链接
    params_dic['save_dir'] = save_dir           # 下载apk保存的目录
    params_dic['app_name'] = app_name           # 要下载的apk的应用名称
    params_dic['app_pn'] = app_pn               # apk包名
    params_dic['app_version'] = app_version     # apk版本号
    params_dic['app_size'] = app_size           # apk文件的大小

    return download(**params_dic)
Beispiel #31
0
def get_yingyongbao_search_list(response):
    log_page(response, 'get_yingyongbao_search_list.html')
    # 应用宝是异步获取json格式的数据。
    data = json.loads(response.body)
    # 获取列表第一条数据
    """
    {"description":"招商银行手机银行3.0全新升级,闪耀登场。完美适配2K大屏安卓手机,包含68项功能更新,为您打造更加专业、简单、安全的移动互联新生活!\r\n
    时代在变,从未改变的是因您而变!\r\n
    六大特性,满足最挑剔的你:\r\n
    ★转账免费:即日起至2015年底,转账0费用,每日高达20万元的转账汇款额度;使用优KEY转账,每日额度更可高至50万元!\r\n
    ★智能金融:账户总览,轻松管理名下所有资产;理财日历,金融琐事智能提醒。\r\n
    ★生活助手:掌上商城、话费充值、商旅预订、彩票投注、电影票在线选座等,是您贴心生活的好助手!\r\n
    ★还款快捷:信用卡账单随查随还,额度实时恢复,更支持中、农、建等多家银行借记卡免手续费还款!\r\n
    ★理财专享:手机银行客户独享专属高收益理财产品。更有专属日日盈产品,满足对流动性有更高要求的您。\r\n
    ★安全无忧:秉承业界最高安全标准,除采用SSL加密通信协议确保数据全程加密,登录IP变动检测、转账额度自主设置等安全措施外、同时增加登录密码键盘加密机制、用户自定义手机银行后台在线等多种防护措施。在涉及用户资金安全的交易中,短信验证码验证用户身份,时刻保障客户资金安全。",
    "flag":16469,
    "fileSize":5424478,
    "authorId":598794,
    "categoryId":107,
    "pkgName":"cmb.pb",
    "appId":6504,
    "appName":"招商银行",
    "apkUrl":"http://dd.myapp.com/16891/FCA4290E1CE5B7A5B2ACFF83AD156BA1.apk?fsname=cmb.pb_3.1.0_310.apk&asr=8eff",
    "versionCode":310,
    "iconUrl":"http://pp.myapp.com/ma_icon/0/icon_6504_21035686_1430874297/96",
    "versionName":"3.1.0",
    "appDownCount":7291974,
    "averageRating":3.5436363636363635,
    "editorIntro":"招商银行,您的贴身金融管家",
    "categoryName":"生活",
    "images":["http://pp.myapp.com/ma_pic2/0/shot_6504_21035686_1_1430874294/550",
              "http://pp.myapp.com/ma_pic2/0/shot_6504_21035686_2_1430874294/550",
              "http://pp.myapp.com/ma_pic2/0/shot_6504_21035686_3_1430874294/550",
              "http://pp.myapp.com/ma_pic2/0/shot_6504_21035686_4_1430874294/550",
              "http://pp.myapp.com/ma_pic2/0/shot_6504_21035686_5_1430874294/550"],
    "apkMd5":"FCA4290E1CE5B7A5B2ACFF83AD156BA1",
    "authorName":"招商银行股份有限公司",
    "apkPublishTime":1430874299,
    "appRatingInfo":{"averageRating":3.5436363636363635,"ratingCount":550,"ratingDistribution":{"1":147,"2":30,"3":37,"4":49,"5":287}}}
    """
    i = data['obj']['appDetails'][0]
    app_name = i['appName']

    apk_name = response.meta['apk_name']

    if app_name.encode('utf8') != apk_name:
        return None

    app_pn = i['pkgName']
    app_link = i['apkUrl']
    app_version = i['versionName']
    app_size = i['fileSize']
    # app_channel = 'yingyongbao'
    app_channel = response.meta['app_channel']
    app_download_times = i['appDownCount']
    save_dir = os.path.sep.join([APK_DOWNLOAD_DIR, apk_name])

    params_dic = {}  # 参数字典
    params_dic['app_channel'] = app_channel  # 渠道
    params_dic['app_detail_url'] = response.url  # apk下载页面
    params_dic['app_download_times'] = app_download_times  # apk下载次数
    params_dic['app_link'] = app_link  # apk下载链接
    params_dic['save_dir'] = save_dir  # 下载apk保存的目录
    params_dic['app_name'] = app_name  # 要下载的apk的应用名称
    params_dic['app_pn'] = app_pn  # apk包名
    params_dic['app_version'] = app_version  # apk版本号
    params_dic['app_size'] = app_size  # apk文件的大小

    return download(**params_dic)
Beispiel #32
0
def get_sina_search_list(response):
    log_page(response, 'get_sina_search_list.html')
    html = Selector(response)
    sina_android_list_url = 'http://down.tech.sina.com.cn' + html.xpath('//*[@id="hover"]/a/@href').extract()[0]
    yield Request(sina_android_list_url, meta=response.meta, callback=get_sina_android_list)
Beispiel #33
0
def get_sina_search_list(response):
    log_page(response, 'get_sina_search_list.html')
    html = Selector(response)
    sina_android_list_url = 'http://down.tech.sina.com.cn' + html.xpath('//*[@id="hover"]/a/@href').extract()[0]
    yield Request(sina_android_list_url, meta=response.meta, callback=get_sina_android_list)
Beispiel #34
0
def get_aliexpress_activity(response):
    log_page(response, 'get_aliexpress_activity.html')
    html = Selector(response)

    activity = html.xpath('//*[@id="key-visual-main"]/div/div/ul/li[2]/a/@href').extract()[0]
    yield Request(activity, callback=get_aliexpress_detail)