This forum is now read-only. Please use our new forums at discuss.codecademy.com.

How to use APIs with Python Forum

View Course

420 points
8cf434e71c785a6c599fbf2fcdc1d906?s=140&d=retro
Submitted by
Foxmarine
almost 3 years ago

4/17: Website not created

Hello everyone, I'm having a problem on the requests part of this tutorial. While calling this code:

from urllib2 import urlopen
website = urlopen('https://placekitten.com/')
kittens = website.read()
print kittens[559:1000]

I'm getting this error message from the python interpreter:

Traceback (most recent call last):
File "python", line 4, in
HTTPError: HTTP Error 403: Forbidden

While getting this message from Codecademy:

Oops, try again. Did you create a variable called website?

What am I doing wrong?


0 votes

permalink

As the Python Interpreter said, you have received a HTTP 403 Error, which means you are being stopped from establishing a connection to the url https://placekitten.com/. This is most probably a problem with your personal firewall settings or web filter.

Try using a proxy, VPN, or SSH tunnel if it still doesn't work.

848 points
252f630586b97efb5f56a6b9ea92d511?s=140&d=retro
Submitted by
DarkxCoder
over 2 years ago