# -*- coding:utf-8 -*- import os import time from selenium.webdriver.common.by import By from AppConfig import apk_path, apk_update_info, apk_version, apk_version_code from ChromeUtil import set_url __author__ = 'Tianc' ''' 360应用渠道 ''' driver = set_url( 'http://dev.360.cn/mod3/mobileapp/?qid=819538888&appid=201495736') time.sleep(2) # 切换到frame中查找元素 def switch_to_frame(): iframe = driver.find_element(By.NAME, 'iframe0') driver.switch_to.frame(iframe) # 开始上传文件 def start_update_file(): switch_to_frame() driver.find_element_by_class_name('btn-link ').click()
# -*- coding:utf-8 -*- import re import time from selenium.webdriver.common.by import By from AppConfig import apk_path, apk_update_info, apk_version from ChromeUtil import set_url __author__ = 'Tianc' ''' 木蚂蚁渠道 ''' driver = set_url('http://dev.mumayi.com/soft/add/id/1154700') driver.find_element_by_class_name('layer-close').click() # 关闭应用认证弹窗 def start_update_file(): driver.find_element_by_name('file').send_keys(apk_path) # 上传文件 time.sleep(2) status = driver.find_element_by_class_name('state') # 获取上传状态 while True: time.sleep(3) if status.text != '上传中' and status.text == '上传成功': print('上传完成:', status.text) update_file_success() break elif status.text != '上传中' or status.text == '正在解包,请耐心等待':
# -*- coding:utf-8 -*- import re import time from selenium.webdriver.common.by import By from AppConfig import apk_path, apk_update_info, apk_version from ChromeUtil import set_url __author__ = 'Tianc' ''' 应用汇渠道 ''' driver = set_url('http://dev.appchina.com/dev/manage/app/upgrade/1122135') driver.find_element_by_class_name('layer-close').click() # 关闭应用认证弹窗 def start_update_file(): driver.find_element_by_name('file').send_keys(apk_path) # 上传文件 time.sleep(2) status = driver.find_element_by_class_name('button-text') # 获取上传状态 while True: time.sleep(3) if status.text != '' and status.text == '上传成功': print('上传完成:', status.text) update_file_success() break elif status.text != '上传中' or status.text == '正在解包,请耐心等待': print('正在上传:', status.text)
# -*- coding:utf-8 -*- import re import time from AppConfig import apk_path, apk_update_info, apk_version from ChromeUtil import set_url __author__ = 'Tianc' ''' 搜狗应用渠道 ''' driver = set_url('http://zhushou.sogou.com/open/app/update.html?id=25590') driver.find_element_by_name('file').send_keys(apk_path) # 上传文件 time.sleep(2) update_info = driver.find_element_by_name('update_info') update_info.clear() # 清空原有更新信息 update_info.send_keys(apk_update_info) # 编辑更新信息 apkInfo = driver.find_element_by_class_name('info').text # apk信息模块 error = driver.find_element_by_class_name('error') # 错误信息 def get_version(): apk = re.findall(r'版本名称:([^;]+)', apkInfo.replace('\n', ';').replace(' ', ''))[0] # 获取页面apk_version return int(apk.replace(".", "")) apk_info = get_version()
# -*- coding:utf-8 -*- import re import time from AppConfig import apk_path, apk_update_info, apk_version, apk_version_code from ChromeUtil import set_url __author__ = 'Tianc' ''' 腾讯渠道 ''' driver = set_url('http://op.open.qq.com/mobile_appinfov2/apkinfo?appid=1101043674') driver.find_element_by_name('file').send_keys(apk_path) # 上传文件 time.sleep(2) update_info = driver.find_element_by_name('update_des') update_info.clear() # 清空原有更新信息 update_info.send_keys(apk_update_info) # 编辑更新信息 while True: time.sleep(3) # 5秒查询一次是否有上传完成提示 try: result_message = driver.find_element_by_id('mode_tips_v2').text # 上传信息 print('result_message', result_message) break except Exception as e: error = '' print('上传中,请等待...') if result_message != '上传成功!':