Example #1
0
def _get_url(url, code='utf-8'):
    html_stream = get_urls_re(url, time=6)
    if True:
        html_stream.encoding = 'gb2312'
    else:
        html_stream.encoding = get_charset(html_stream.text)
    return html_stream
Example #2
0
File: cqn.py Project: xxguo/crawler
def _get_url(url, code='utf-8'):
    html_stream = get_urls_re(url, time = 6)
    if True:
        html_stream.encoding = "gb2312"
    else:
        html_stream.encoding = get_charset(html_stream.text)
    return html_stream
Example #3
0
def _get_url(url, code='utf-8'):
    html_stream = get_urls_re(url, time = 6)
    if True:
        html_stream.encoding = 'GBK'
    else:
        html_stream.encoding = get_charset(html_stream.text)
    if html_stream.status_code != 200:
        return html_stream
    return html_stream