コード例 #1
0
ファイル: scaulife.py プロジェクト: kevensusu/part-time-job
def handle_job_info(info):
        tools.sleep_some_time()
        title,link,release_time=info
        url=url_host+link
        info={}
        info['title']=title
        info['web_url']=url
        info['release_time']=tools.get_real_time(release_time)
        info['job_type']=0
        info['authentication']=0
        info.update(get_message_jobs(url))
        print(info['title'],info['company'],info['release_time'])
        return info
コード例 #2
0
ファイル: scau_info.py プロジェクト: kevensusu/part-time-job
def handle_job_message(obj):
    """
    处理兼职信息
    :param obj:
    :return:
    """
    tools.sleep_some_time()
    response = requests.get(obj['web_url'])
    if response.status_code != 200:
        log.error("网址(%s)无法访问,状态码:%d" % (obj['web_url'], response.status_code))
        return obj

    obj['web_html'] = response.content
    obj['company'] = tools.get_company_name(obj['web_html'])
    obj['position'] = tools.get_work_position(obj['web_html'])
    obj['work_city'] = tools.get_work_citys(obj['web_html'])
    return obj
コード例 #3
0
def handle_job_message(obj):
    """
    处理兼职信息
    :param obj:
    :return:
    """
    tools.sleep_some_time()
    response = requests.get(obj['web_url'])
    if response.status_code != 200:
        log.error("网址(%s)无法访问,状态码:%d" % (obj['web_url'], response.status_code))
        return obj

    obj['web_html'] = response.content
    obj['company'] = tools.get_company_name(obj['web_html'])
    obj['position'] = tools.get_work_position(obj['web_html'])
    obj['work_city'] = tools.get_work_citys(obj['web_html'])
    return obj
コード例 #4
0
def handle_all_data(url):
    """
    获取每一条信息
    :param url:
    :return:
    """
    tools.sleep_some_time()
    zhaopin_data = {}
    html = Get_html(url)
    zhaopin_data['web_url'] = url
    zhaopin_data['web_html'] = html
    zhaopin_data['title'] = get_title(html)
    zhaopin_data['release_time'] = tools.get_real_time(get_date(html))
    zhaopin_data['company'] = tools.get_company_name(html)
    zhaopin_data['position'] = tools.get_work_position(html)
    zhaopin_data['work_city'] = tools.get_work_citys(html)
    zhaopin_data['message_source'] = '华农园艺学院官网'
    print(zhaopin_data['title'],zhaopin_data['release_time'],zhaopin_data['message_source'],zhaopin_data['company'])
    return zhaopin_data
コード例 #5
0
ファイル: scaurw.py プロジェクト: kevensusu/part-time-job
def fetch():
    result=[]
    infos = get_message_title_and_url_list(1)

    for info in infos:
        tools.sleep_some_time()
        title,link=info
        url=url_host+link
        info={}
        info['title']=title
        info['web_url']=url
        info['message_source']="生命科学学院官网"
        info['job_type']=0
        info['authentication']=0
        info.update(get_message_jobs(url))
        result.append(info)
        print(info['title'],info['company'],info['release_time'])

    return result
コード例 #6
0
ファイル: scaurw.py プロジェクト: kevensusu/part-time-job
def fetch():
    result = []
    infos = get_message_title_and_url_list(1)

    for info in infos:
        tools.sleep_some_time()
        title, link = info
        url = url_host + link
        info = {}
        info['title'] = title
        info['web_url'] = url
        info['message_source'] = "生命科学学院官网"
        info['job_type'] = 0
        info['authentication'] = 0
        info.update(get_message_jobs(url))
        result.append(info)
        print(info['title'], info['company'], info['release_time'])

    return result
コード例 #7
0
def handle_all_data(url):
    """
    获取每一条信息
    :param url:
    :return:
    """
    tools.sleep_some_time()
    zhaopin_data = {}
    html = Get_html(url)
    zhaopin_data['web_url'] = url
    zhaopin_data['web_html'] = html
    zhaopin_data['title'] = get_title(html)
    zhaopin_data['release_time'] = tools.get_real_time(get_date(html))
    zhaopin_data['company'] = tools.get_company_name(html)
    zhaopin_data['position'] = tools.get_work_position(html)
    zhaopin_data['work_city'] = tools.get_work_citys(html)
    zhaopin_data['message_source'] = '华农资环学院官网'
    print(zhaopin_data['title'], zhaopin_data['release_time'],
          zhaopin_data['message_source'], zhaopin_data['company'])
    return zhaopin_data