Skip to content

Commit

Permalink
修复了随机索引越界错误
Browse files Browse the repository at this point in the history
  • Loading branch information
vansl committed Dec 6, 2017
1 parent 8964144 commit 6900b9a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spider.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import requests
import re
import random

import shutil
def parse (imgHash, constant):
q = 4
hashlib.md5()
Expand Down Expand Up @@ -91,9 +91,9 @@ def spider():

indexList=[]
for i in range(5):
index=int(random.random()*30)
index=int(random.random()*len(hashList))
while index in indexList:
index=int(random.random()*30)
index=int(random.random()*len(hashList))
indexList.append(index)

for index in indexList:
Expand Down

0 comments on commit 6900b9a

Please sign in to comment.