def __init__(self, name="留存率采集任务"):
        """

        :type name: object task name
        """
        self.name = name
        self.url = config.get_umeng()["url"]["retention_rate_day"]
Ejemplo n.º 2
0
def __login_umeng():
    driver = webdriver.PhantomJS(
        executable_path=config.get_global()["selenium"]["driver_path"])
    driver.get(config.get_umeng()["url"]["login"])
    wait = WebDriverWait(driver, 30)
    try:
        wait.until(EC.element_to_be_clickable((By.ID, 'submitForm')))
        log.get_log().info("页面加载完成")
    except Exception as e:
        log.get_log().error("等待登录页面错误错误")
        ex.collection_ex(e)
    else:  # auto login
        driver.find_element_by_css_selector("#ump .loginForm .list input[type='text']")\
            .send_keys(config.get_umeng()["user_name"])
        driver.find_element_by_css_selector("#ump .loginForm .list input[type='password']")\
            .send_keys(config.get_umeng()["password"])
        driver.find_element_by_id('submitForm').click()
        time.sleep(5)  # 等待一段时间,用于页面跳转
    return driver
Ejemplo n.º 3
0
 def __init__(self, name="渠道采集任务"):
     self.name = name
     self.url = config.get_umeng()["url"]["channels"]
Ejemplo n.º 4
0
 def set_other_url(self):
     self.url = config.get_umeng()["url"]["user_analysis"]
Ejemplo n.º 5
0
 def __init__(self, name="用户分析"):
     self.name = name
     self.url = config.get_umeng()["url"]["user_analysis"]
Ejemplo n.º 6
0
def __session_is_timeout():
    return time.time() > request_session_cache["update_time"] \
                         + config.get_umeng()["session_timeout"]
Ejemplo n.º 7
0
 def set_hourly_url(self):
     self.url = config.get_umeng()["url"]["user_analysis_launch_hourly"]