鱼C论坛

 找回密码
 立即注册
查看: 1474|回复: 1

53讲里爬虫第一课问题,求助谢谢

[复制链接]
头像被屏蔽
发表于 2018-5-6 23:03:50 | 显示全部楼层 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2018-5-6 23:55:31 | 显示全部楼层
   encode = chardet.detect(html)['encoding']
        
        if encode == 'GB2312':
            encode = content.encode("GBK")
            
        
        i += 1
        filename = "url_%d.txt" % i

        each_file=open(filename, "w")
虽然不知道python 3的语法 猜应该这样吧
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

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

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-12-30 00:43

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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