Python 只能检索有限数量的页面

Python 只能检索有限数量的页面,python,http,ssl,imgur,rate-limiting,Python,Http,Ssl,Imgur,Rate Limiting,我想知道为什么我不能在165页之后检索更多的数据页 page number is: 165 4 image/gif page number is: 165 13 page number is: 165 3 page number is: 165 /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext ob

我想知道为什么我不能在165页之后检索更多的数据页

page number is: 165
4
image/gif
page number is: 165
13
page number is: 165
3
page number is: 165
/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
代码如下:

 33 p=0
 34 while True:
 35     p += 1
 36     time.sleep(2)
 37     try:
 38         search = imgur_client.gallery_search('cat', window='all', sort='time', page=p)
 39         for i in range(0, len(search)):
 40             item_count +=1 
 41             print(search[i].comment_count)
 42             if not search[i].is_album:
 43                 print(search[i].type) 
 44             print('{0}: {1}'.format("page number is", p))
 45             if search[i].comment_count > 10 and not search[i].is_album:
 46                 if search[i].type[6:] in image_type:
 47                     count = 0
 48                     try:
 49                         image_file = urllib2.urlopen(search[i].link, timeout = 5)
 50                         image_file_name = 'images/'+ search[i].id+'.'+search[i].type[6:]
 51                         output_image = open(image_file_name, 'wb') 
 52                         output_image.write(image_file.read())
 53                         for post in imgur_client.gallery_item_comments(search[i].id, sort='best'):
 54                             if count <= 10:
 55                                 count += 1
 56                         output_image.close()
 57                     except urllib2.URLError as e:
 58                         print(e)
 59                         continue
 60                     except socket.timeout as e:
 61                         print(e)
 62                         continue
 63                     except socket.error as e:
 64                         print(e)
 65                         continue
 66     except ImgurClientError as e:
 67         print(e)
 68         continue
33 p=0
34尽管如此:
35 p+=1
36时间。睡眠(2)
37尝试:
38 search=imgur\u client.gallery\u search('cat',window='all',sort='time',page=p)
39对于范围(0,len(搜索))中的i:
40项目计数+=1
41打印(搜索[i]。注释计数)
42如果不是,则搜索[i]。是\u相册:
43打印(搜索[i]。键入)
44打印({0}:{1})。格式(“页码为”,p))
45如果搜索[i]。注释计数>10,而不是搜索[i]。是否为\U相册:
46如果搜索[i]。在图像中键入[6:]\u类型:
47计数=0
48尝试:
49 image_file=urllib2.urlopen(搜索[i]。链接,超时=5)
50图像文件名称='images/'+search[i].id+'.+search[i]。键入[6:]
51输出图像=打开(图像文件名称“wb”)
52输出\u image.write(image\u file.read())
53在imgur_client.gallery_item_评论中发表帖子(搜索[i].id,sort='best'):
54如果算上