qiyeboy / SpiderBook

<<python爬虫开发与项目实战>>书籍配套源码和说明

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

第七章的那个URLManager.py是错的。

wangledd opened this issue · comments

我的运行环境是py3.6

self.new_urls = self.load_proc("new_urls.txt")
而 self.load_proc() return 的是 tmp ,tmp是str类型
而你在函数add_new_url 中 使用了 self.new_urls.add()

str对象应该没有add方法吧。。。。。。。。

commented

你可能不太明白Python的序列化,tmp是set类型,你查一下cpickle的用法,这个项目是没有问题的,交流群有运行视频@wangledd