Esempio n. 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
Esempio n. 2
0
File: cqn.py Progetto: 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
Esempio n. 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