def automatic_detect(url):
    '''
    @contact: 用于检测网页编码，需要urllib，chardet
    @url:输入链接
    '''
    
    content = urllib.urlopen(url).read()    #读取网页内容
    result = chardet.detect(content)        #检测网页编码
    encoding = result['encoding']
    return encoding