找回密码
 立即注册

扫一扫,访问微社区

QQ登录

只需一步,快速开始

查看: 2887|回复: 0

python unicode 包的安装

1

主题

1

帖子

1

积分

贫民

积分
1
simonsong 发表于 2022-11-13 13:00:12 | 显示全部楼层 |阅读模式
先上代码:import unicode


def pa(url_pa, filebox):
    def get_html(asd):
        headers = {"User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36"}
        req = urllib.request.Request(url=asd, headers=headers)
        html = urlopen(req)
        print(html)
        qwe = html.read()
        qw = unicode(qwe, 'gb2312').encode('utf-8')
东西是爬虫相关的,刚开始学,现在的问题是,最后一行unicode 总是提示没有unicode的包,我安装了也找不到这个包,各位前辈,怎么回事,是我安装的包名字不对,还是什么问题,感谢!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表