示例#1
0
def retrieve_url(paras):
    """Retrieve web pages from url
    """
    logging.info('URL: {0}'.format(paras[0]))
    web = api.api_call2(*api.urlsplit(paras[0])).read(). \
            decode('utf-8', errors='ignore')
    web = web.replace('\n', ' ')
    web = web.replace('\r', ' ')
    return ' '.join([paras[0], web])
示例#2
0
def retrieve_url(paras):
    """Retrieve web pages from url
    """
    logging.info('URL: {0}'.format(paras[0]))
    web = api.api_call2(*api.urlsplit(paras[0])).read(). \
            decode('utf-8', errors='ignore')
    web = web.replace('\n', ' ')
    web = web.replace('\r', ' ')
    return ' '.join([paras[0], web])
示例#3
0
def webpage_by_url(paras):
    """Retrieve web pages from url
    """
    logging.info('URL: {0}'.format(paras[1]))
    try:
        web = api.api_call2(*api.urlsplit(paras[1])).read(). \
                decode('utf-8', errors='ignore')
        if len(web) == 0:
            return {'list': list(),}
        return {'list': ({'place_id': paras[0], \
                'web': web},)}
    except:
        return {'list': list(),}
示例#4
0
def webpage_by_url(paras):
    """Retrieve web pages from url
    """
    logging.info('URL: {0}'.format(paras[1]))
    try:
        web = api.api_call2(*api.urlsplit(paras[1])).read(). \
                decode('utf-8', errors='ignore')
        if len(web) == 0:
            return {
                'list': list(),
            }
        return {'list': ({'place_id': paras[0], \
                'web': web},)}
    except:
        return {
            'list': list(),
        }