imgur-hosted-reddit-posted-downloader icon indicating copy to clipboard operation
imgur-hosted-reddit-posted-downloader copied to clipboard

Index out of range

Open ajstamps opened this issue 10 years ago • 3 comments

When the image is an Imgur page with a single page, it causes an index error.

imageUrl = soup.select('.image a')[0]['href'] IndexError: list index out of range

there is the code and error.

ajstamps avatar Jul 15 '15 22:07 ajstamps

The fix for me was to change the '.image a' to 'link' and the [0] to [10]

ajstamps avatar Jul 15 '15 23:07 ajstamps

This seems to fix but the issue is still present when downloading multiple images.

navchandar avatar Mar 12 '16 11:03 navchandar

@ajstamps @navchandar what you said didn't work as a fix for me:

[LOG] Getting url:  http://imgur.com/a/yOLjm
Traceback (most recent call last):
  File "download_images.py", line 43, in <module>
    image_url = soup.select('link a')[10]['href']
IndexError: list index out of range

monajalal avatar Oct 05 '16 03:10 monajalal