编程论坛
注册
登录
编程论坛
→
Python论坛
内建函数 hash()可以用来去掉重复的 url 吗?
随风而行lulu
发布于 2014-11-10 20:45, 1995 次点击
爬虫的网站页面不是特别多
hash()返回的是int类型啊,有的8位,有的9位,基本上是8位。用这个来判断url重复准确吗?
1 回复
#2
succubus
2014-11-15 13:11
多用help啊
>>> help(hash)
Help on built-in function hash in module __builtin__:
hash(...)
hash(object) -> integer
Return a hash value for the object. Two objects with the same value have
the same hash value. The reverse is not necessarily true, but likely.
1