Python for Everybody - ERROR: Page Spider Exercise

Hi everyone,

I’m trying to complete the Page Spider Exercise linked in the last lesson of the Python for Everybody course, so I can better understand the learnings.

However, when I try to run the program ( it comes up with an error, like this:

users-MacBook-Air:webspider abigailnottingham$ python3
Enter web url or enter:
How many pages:5
1 h… Unable to retrieve or parse page
No unretrieved HTML pages found

I’ve watched the exercise video and Dr Chuck says that if this error comes up it’s likely an issue with BeautifulSoup or something, but I have version 4 installed which is the latest version.

Does anyone have any ideas why this won’t run for me?

The file I’m using is located on the PY4E website: