How to use APIs with Python - Lesson 5


from urllib2 import urlopen

Open for reading on line 4!

kittens = urlopen('')
response =
body = response[559:1000]

print body

  • Whats wrong with this code. Any ideas as to hy am I getting this error?

Traceback (most recent call last):
File "python", line 4, in


The connection is being refused, I can't resume either

#3 is broken. it should return an image when hitting in a browser.

This lesson needs a new api to hit.