imgur-hosted-reddit-posted-downloader
imgur-hosted-reddit-posted-downloader copied to clipboard
Index out of range
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.
The fix for me was to change the '.image a' to 'link' and the [0] to [10]
This seems to fix but the issue is still present when downloading multiple images.
@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